Enhance your understanding with the System Software, Architecture, Memory and Storage Test. Study with flashcards and multiple choice questions. Each question offers hints and detailed explanations. Prepare effectively for your exam!

Multiple Choice

In memory allocators, what problem does memory compaction primarily address?

Memory compaction is about fixing external fragmentation in heap memory. As allocations and frees scatter blocks of free memory between allocated objects, you can end up with lots of small holes even though the total free space is enough for a large request. Compaction moves allocated blocks closer together, usually toward one end, so all the free space becomes one large contiguous region. This makes it possible to satisfy big allocations that would fail with scattered free blocks, at the cost of copying data and updating references. Other options don’t address this problem. Paging deals with dividing memory into fixed-size pages and isn’t about merging free space. Cache coherence concerns keeping multiple caches consistent in a multicore system, not reorganizing memory. TLB misses relate to address translation performance, which compaction doesn’t directly resolve.

Memory compaction is about fixing external fragmentation in heap memory. As allocations and frees scatter blocks of free memory between allocated objects, you can end up with lots of small holes even though the total free space is enough for a large request. Compaction moves allocated blocks closer together, usually toward one end, so all the free space becomes one large contiguous region. This makes it possible to satisfy big allocations that would fail with scattered free blocks, at the cost of copying data and updating references.

Other options don’t address this problem. Paging deals with dividing memory into fixed-size pages and isn’t about merging free space. Cache coherence concerns keeping multiple caches consistent in a multicore system, not reorganizing memory. TLB misses relate to address translation performance, which compaction doesn’t directly resolve.