Machine-translated by Google. Questions are authored in English.
Top

Discussion

Compaction is used to solve which problem?

  • A.External fragmentation
  • B.Internal fragmentation
  • C.Page faults
  • D.Deadlock

Answer: A

Correct answer: External fragmentation

Compaction moves allocated blocks together at one end of memory so that all the free space forms a single large hole. It is the remedy for external fragmentation, where enough total memory is free but it is scattered in pieces too small to be useful. It has two serious costs. Copying every process is expensive, and the system can do nothing else meanwhile. And it is possible only if relocation is dynamic - addresses bound at execution time through a base register - since a process whose addresses were fixed at load time cannot be moved. It does nothing for internal fragmentation, which is space wasted inside an allocated block and cannot be recovered by rearrangement. The better answer to external fragmentation is paging, which removes the problem by definition: since any free frame will serve for any page, physical contiguity is never required and there is nothing to compact. Compaction survives in garbage-collected runtimes, where it consolidates the heap.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.