Difficulty: Medium
Correct Answer: Compaction does not involve relocation of programs
Explanation:
Introduction / Context:
Compaction is used to combat external fragmentation by moving allocated blocks together to create larger contiguous free regions. This requires careful handling of address-sensitive data and typically involves relocating programs or data segments so that references remain valid after movement.
Given Data / Assumptions:
Concept / Approach:
To compact memory, the OS moves occupied regions and updates pointers/relocation info. Therefore, compaction inherently involves relocation. Many systems perform compaction during a stop-the-world pause; some advanced runtimes use incremental or concurrent techniques, but relocation is still fundamental. In introductory OS contexts, compaction may be discussed alongside garbage collection, which reclaims unreachable objects and often compacts live ones.
Step-by-Step Solution:
Verification / Alternative check:
After compaction, memory maps (for example, via a diagnostic) show fewer, larger free segments; addresses visible to processes are updated via relocation hardware or translation tables, confirming that relocation occurred.
Why Other Options Are Wrong:
Common Pitfalls:
Believing compaction is only about free lists without moving live data, or assuming it can always be done transparently with zero pause (which is nontrivial).
Final Answer:
Compaction does not involve relocation of programs
Discussion & Comments