Answer: 3:3
We are given the initial set of 8 memory holes of sizes:
{20 KB,4 KB,25 KB,18 KB,7 KB,9 KB,15 KB,12 KB}
Using the best-fit allocation strategy, we allocate memory to processes P1 and P2 in order:
- Allocation of P1 (16 KB):
The available holes of size ≥16 KB are 18 KB, 20 KB, and 25 KB. The best-fit (smallest sufficient) hole is 18 KB.
After allocation, the remaining hole size is 18−16=2 KB.
The updated set of holes is: {20 KB,4 KB,25 KB,2 KB,7 KB,9 KB,15 KB,12 KB}. - Allocation of P2 (9 KB):
The available holes of size ≥9 KB are 9 KB, 12 KB, 15 KB, 20 KB, and 25 KB. The best-fit hole is exactly 9 KB.
After allocation, no remaining hole is left from this block (9−9=0 KB).
The final set of holes is: {20 KB,4 KB,25 KB,2 KB,7 KB,15 KB,12 KB}.
Now, we count the number of holes of size less than 8 KB:
- 4 KB (Yes)
- 2 KB (Yes)
- 7 KB (Yes)
Thus, there are exactly 3 holes of size less than 8 KB.