In memory management, which statement about storage compaction is FALSE with respect to relocating programs and system activity during compaction?

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:

  • External fragmentation exists due to variable-sized allocations and deallocations.
  • Compaction attempts to consolidate free space into a single large block.
  • Relocation mechanisms (hardware or software) are available.


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:

1) Identify fragmented layout: many small free holes.2) Move allocated blocks to one side to coalesce free space.3) Update relocation entries, base/limit, or page/frame mappings as applicable.4) Resume execution with a larger contiguous free region.


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:

  • The technique moves occupied areas: Correct; that is the essence of compaction.
  • Known as garbage collection: In simplified treatments, GC often includes compaction of live objects; the association is common.
  • System pause: Many implementations halt normal execution during compaction for consistency.
  • None of the above: Incorrect because one statement is false.


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

No comments yet. Be the first to comment!
Join Discussion