GateAI
Memory Management and Virtual Memory

GATE CSE 2026 Set 2 · Q55

NAT2 marksEasy

Time

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=2102^{10}

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 3

Memory Management and Virtual Memory
  1. Initial set of holes (in KB):

    {20,4,25,18,7,9,15,12}\{20, 4, 25, 18, 7, 9, 15, 12\}
  2. Allocation of P1 (16 KB):

    • Eligible holes (≥16 KB)(\ge 16\text{ KB}): {18,20,25}\{18, 20, 25\}.

    • Best-fit selects the smallest eligible hole: 18 KB18\text{ KB}.

    • Remaining hole size: 18−16=2 KB18 - 16 = 2\text{ KB}.

    • Updated list of holes: {20,4,25,2,7,9,15,12}\{20, 4, 25, 2, 7, 9, 15, 12\}.

  3. Allocation of P2 (9 KB):

    • Eligible holes (≥9 KB)(\ge 9\text{ KB}): {9,12,15,20,25}\{9, 12, 15, 20, 25\}.

    • Best-fit selects the smallest eligible hole: 9 KB9\text{ KB}.

    • Remaining hole size: 9−9=0 KB9 - 9 = 0\text{ KB} (hole completely occupied and removed).

    • Final list of holes: {20,4,25,2,7,15,12}\{20, 4, 25, 2, 7, 15, 12\}.

  4. Counting holes of size less than 8 KB:

    • The holes of size <8 KB< 8\text{ KB} are: 4 KB4\text{ KB}, 2 KB2\text{ KB}, and 7 KB7\text{ KB}.

    • Total count = 3.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Memory Management and Virtual Memory previous year question is Q55 of the GATE CSE 2026 Set 2 paper. Find more GATE CSE PYQs on Memory Management and Virtual Memory in Operating Systems, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Memory Management and Virtual Memory PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Memory Management and Virtual Memory in GATE CSE

Memory Management and Virtual Memory has 32 GATE CSE PYQs across 22 papers from 2011 to 2026. 15 of them are 2-mark NAT questions like this one, and GATE CSE 2026 Set 2 has 2.

How GATE tests Memory Management and Virtual Memory

More from GATE CSE 2026 Set 2

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2026 Set 2 · Q55 · NAT

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

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.