CS FundamentalsVery hardGATE CS (PYQ pattern)
Holes in memory (in KB, in address order): 250, 240, 230, 180, 140. Processes arrive and stay resident in this order: 100, 190, 200, 150, 250 KB. A chosen hole is split and the remainder stays as a hole; there is no compaction. Which allocation policies place ALL five processes?
- A. Best-fit only
- B. First-fit only
- C. Worst-fit only
- D. First-fit and best-fit only
Correct answer: A. Best-fit only
Simulation with holes [250, 240, 230, 180, 140]: first-fit and worst-fit each leave a process unplaced, while best-fit keeps the right-sized hole for the large processes and places all five.
More Operating Systems questions
- A disk delivers 20 MB/s (1 MB = 10^6 bytes) to memory by DMA, 4 bytes per bus cycle. Each word transfer steals one 40 ns memory cycle from…
- Three threads each execute x = x + 1; twice on a shared int x that starts at 0 (so six increments in all). Each increment is a separate…
- A process has a 1 MB address space split into 4 segments, each paged separately; the single-level page tables together need one 8-byte…
- A process owns 100 private writable pages. It calls fork() and both processes use copy-on-write. Before either exits, the child writes to…
- A RAID 5 array has 6 disks, each able to do 150 random I/O operations per second. A small RAID 5 write costs 4 disk I/Os (read old data…
- A 512 x 512 matrix of 4-byte integers is stored row-major, starting at a page boundary, with 4 KB pages (so two rows per page). The code…