Memory compaction enhancement 

1. fix division-by-zero panic while triggering compaction via sy