GATE / CS ARCHIVE

SIMILAR QUESTIONS / OPERATING SYSTEMS

Update holes under sequential best fit

2 questions solved the same way, newest first. Back to Operating Systems

How these are solved

Choose the smallest adequate current hole for each arrival and update residual space. 2015 asks untouched original partitions;

2 marks · NAT
Report issue

Best-fit allocations and remaining holes

Memory Allocation & Segmentation

Question 55, GATE 2026: Nonadjacent free holes have sizes 20,4,25,18,7,9,15,12 KB. Allocate a 16 KB process and then a 9 KB process by best fit. How many remaining holes are smaller than 8 KB?
Tap to enlarge
Answer & solution

Official answer: 3

Givens and goal

Nonadjacent free holes have sizes 20,4,25,18,7,9,15,12 KB. Allocate a 16 KB process and then a 9 KB process by best fit. How many remaining holes are smaller than 8 KB?

Approach

At each arrival choose the smallest currently adequate hole, then update the list.

Step-by-step solution

1. For the 16 KB request the adequate holes are 18,20,25 KB. Best fit chooses 18 KB, leaving an 18−16=2 KB fragment. The 15 KB and smaller holes cannot accommodate it.
2. Afterward the hole sizes are 20,4,25,2,7,9,15,12 KB. For the 9 KB request, the 9 KB hole is an exact fit and is removed entirely; it does not remain as a zero-size hole.
3. The final positive hole sizes are 20,4,25,2,7,15,12 KB. Those strictly less than 8 KB are 4,2,7 KB, giving three holes.
4. No coalescing is performed because the original holes are nonadjacent and these operations only split or consume them. The answer is 3. Always recompute the available holes after the first allocation rather than assigning both requests independently to the original list.

Original paper, page 39 · Answer key

2 marks · MCQ
Report issue

Memory Allocation & Segmentation

Question 41, GATE 2015: Free partitions 200, 400, 600, 500, 300, 250 KB. Allocate processes 357, 210, 468, 491 KB in order using bestfit. Which original partitions stay unused? A200, 300; B200, 250; C250, 300; D300, 400.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Best fit assigns 357 to 400, 210 to 250, 468 to 500, and 491 to 600. Original partitions 200 and 300 remain unused, A. Splitting residual space does not alter these choices.

At each request choose the smallest remaining partition large enough.357 fits 400, 500, 600; choose 400.210 fits 250, 300, 500, 600; choose 250.468 fits 500 or 600; choose 500.491 then uses 600. The unused original partitions are 200 and 300. If partitions are split, the resulting remnants 43, 40, 32 and 109 are all too small to change these subsequent choices, so the answer remains the same.

Original paper, page 40 · Answer key