Implementing compaction/garbage collection.