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?
- A. 570 KB copied, 330 KB hole
- B. 420 KB copied, 330 KB hole
- C. 420 KB copied, 270 KB hole
- 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
- A 100 MB process is swapped out and later swapped back in on a disk that transfers 50 MB/s with an 8 ms latency per transfer. Swap-out…
- Disk requests arrive as a Poisson stream of 100 per second; service times are exponential (M/M/1 per disk). Option X buys one disk twice…
- Round Robin uses a 20 ms quantum and every context switch costs 2 ms; all n processes are CPU-bound and always use the full quantum. From…
- A ticket lock has nextticket = 10 and nowserving = 10 (free). Events in order: T1 acquires, T2 acquires, T3 acquires, T1 releases, T4…
- Which of the following statements about read-copy-update (RCU) are correct? I. Readers traverse the data structure without taking locks…
- Which of the following statements about fork() with copy-on-write are correct? I. Right after fork, parent and child map the same physical…