When reading to the end of the segment file, clearing the block did not release the memory, leading to high memory usage during compaction. When reading through segment file for columns that are dictionary encoded, the column iterator in the segment iterator will hold the dictionary. Release the segment iterator to free up the dictionary.