GateAI
Memory Management and Virtual Memory

GATE CSE 2014 Set 1 · Q33

NAT2 marksEasy

Time

Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the *optimal replacement policy* is _________.

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 7

Memory Management and Virtual Memory

We trace the optimal page replacement algorithm with 3 frames for the reference string:

Reference String: 1,2,3,4,2,1,5,3,2,4,6\text{Reference String: } 1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6
  1. Ref 1: Miss (Page Fault 1). Frames: [1,−,−][1, -, -]

  2. Ref 2: Miss (Page Fault 2). Frames: [1,2,−][1, 2, -]

  3. Ref 3: Miss (Page Fault 3). Frames: [1,2,3][1, 2, 3]

  4. Ref 4: Miss (Page Fault 4). Future references: 22 (next), 11 (soon after), 33 (later). Replace page 33 (farthest in future). Frames: [1,2,4][1, 2, 4]

  5. Ref 2: Hit. Frames: [1,2,4][1, 2, 4]

  6. Ref 1: Hit. Frames: [1,2,4][1, 2, 4]

  7. Ref 5: Miss (Page Fault 5). Future references: 33, 22, 44, 66. Pages in frames are 1,2,41, 2, 4. Page 11 is never referenced again. Replace page 11. Frames: [5,2,4][5, 2, 4]

  8. Ref 3: Miss (Page Fault 6). Future references: 22, 44, 66. Pages in frames are 5,2,45, 2, 4. Page 55 is never referenced again. Replace page 55. Frames: [3,2,4][3, 2, 4]

  9. Ref 2: Hit. Frames: [3,2,4][3, 2, 4]

  10. Ref 4: Hit. Frames: [3,2,4][3, 2, 4]

  11. Ref 6: Miss (Page Fault 7). Replace any page (e.g., 33). Frames: [6,2,4][6, 2, 4]

Total number of page faults = 7.

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 Q33 of the GATE CSE 2014 Set 1 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 it is the only one in GATE CSE 2014 Set 1.

How GATE tests Memory Management and Virtual Memory

More from GATE CSE 2014 Set 1

Share this solution

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

GateAI solution cardGATE CSE 2014 Set 1 · Q33 · NAT

Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the *optimal replacement policy* is …

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.