Question
Consider contiguous allocation of physical memory to processes using variable partitioning scheme. Suppose there are 8 holes in the memory of sizes 20 KB, 4 KB, 25 KB, 18 KB, 7 KB, 9 KB, 15 KB, and 12 KB. Assume that no two holes are adjacent. Two processes P1 of size 16 KB and P2 of size 9 KB arrive in that order, and they are allocated memory using the best-fit technique. After allocating space to P1 and P2, the number of holes of size less than 8 KB is ____________. (answer in integer)
Note:
Official answer and solution
- Official answer
- 3
- From
- Official GATE 2026 answer key
Solution
Allocate P1 (16 KB) and P2 (9 KB) using Best-Fit and count the remaining non-zero holes strictly smaller than 8 KB.
Initial holes: KB.
- P1 (16 KB) arrives: Under Best-Fit, the smallest hole is the hole, leaving a leftover hole of size .
- P2 (9 KB) arrives: The smallest hole is the hole, which is used completely (, no hole remains).
Remaining holes: KB.
The holes with size are and , which gives a total of holes.
3
Counting the completely filled 9 KB partition (0 KB remainder) as a hole.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2026 Computer Science and Information Technology - Session 2 (CS2)
- Question
- 55 of 65
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.