Computer Sciences > GATE 2026 SET-2 > Operating System
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: 1K=210

Correct : 3

The correct answer is 3.
Initial holes: 20, 4, 25, 18, 7, 9, 15, 12 KB.
Allocating P1 (16 KB) using best-fit: Holes large enough: 20, 25, 18 KB. Smallest sufficient = 18 KB. Remainder = 18 − 16 = 2 KB. Holes become: 20, 4, 25, 2, 7, 9, 15, 12 KB.
Allocating P2 (9 KB) using best-fit: Holes large enough: 20, 25, 9, 15, 12 KB. Smallest sufficient = 9 KB (exact fit, no remainder). The 9 KB hole is fully consumed. Holes become: 20, 4, 25, 2, 7, 15, 12 KB.
Holes with size less than 8 KB: 4, 2, 7 KB → 3 holes

Similar Questions

Consider the following five disk five disk access requests of the form (request id, cylinder number) that are present in the disk scheduler queue at a given tim...
#276 MCQ
Which one of the following CPU scheduling algorithms cannot be preemptive?
#1568 MCQ
Consider three processes P1, P2, and P3 running identical code, as shown in the pseudocode below. A and B are two binary semaphores initialized to 1 and 0,...
#1597 MSQ

Related Topics

GATE CS 2026 Set-2 Q55 best-fit memory allocation GATE 2026 variable partitioning GATE CS holes less than 8KB GATE memory management best fit GATE 2026 operating system GATE CS 2026 contiguous memory allocation GATE best fit exact fit GATE CS

Unique Visitor Count

Total Unique Visitors

Loading......