CS FundamentalsVery hardGATE CS (PYQ pattern)

Memory (in KB, from address 0): OS 100, process A 150, hole 60, B 200, hole 90, C 120, hole 80, D 100, hole 100. Compaction slides every process downward so that all holes merge at the top; a process already adjacent to the previous block is not moved. How many KB of data are copied, and how large is the single hole afterwards?

  1. A. 570 KB copied, 330 KB hole
  2. B. 420 KB copied, 330 KB hole
  3. C. 420 KB copied, 270 KB hole
  4. D. 320 KB copied, 330 KB hole

Correct answer: B. 420 KB copied, 330 KB hole

A and the OS stay in place. B, C and D lie above the first hole and are all copied: 200 + 120 + 100 = 420 KB. The holes 60 + 90 + 80 + 100 = 330 KB merge into one.

More Operating Systems questions

Exams that ask this topic