GateAI
Memory Management and Virtual Memory

GATE CSE 2022 · Q64

NAT2 marksMedium

Time

Consider a demand paging system with four page frames (initially empty) and LRU page replacement policy. For the following page reference string 7,2,7,3,2,5,3,4,6,7,7,1,5,6,17, 2, 7, 3, 2, 5, 3, 4, 6, 7, 7, 1, 5, 6, 1 the page fault rate, defined as the ratio of number of page faults to the number of memory accesses (rounded off to one decimal place) is ________.

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 0.6

Memory Management and Virtual Memory

We simulate the LRU replacement policy with 4 page frames for the reference string of length 15:

  1. Ref 7: Page Fault (PF 1), Frames: [7][7]

  2. Ref 2: Page Fault (PF 2), Frames: [7,2][7, 2]

  3. Ref 7: Hit, Frames: [2,7][2, 7]

  4. Ref 3: Page Fault (PF 3), Frames: [2,7,3][2, 7, 3]

  5. Ref 2: Hit, Frames: [7,3,2][7, 3, 2]

  6. Ref 5: Page Fault (PF 4), Frames: [7,3,2,5][7, 3, 2, 5]

  7. Ref 3: Hit, Frames: [7,2,5,3][7, 2, 5, 3]

  8. Ref 4: Page Fault (PF 5), Evict 7 (LRU), Frames: [2,5,3,4][2, 5, 3, 4]

  9. Ref 6: Page Fault (PF 6), Evict 2 (LRU), Frames: [5,3,4,6][5, 3, 4, 6]

  10. Ref 7: Page Fault (PF 7), Evict 5 (LRU), Frames: [3,4,6,7][3, 4, 6, 7]

  11. Ref 7: Hit, Frames: [3,4,6,7][3, 4, 6, 7]

  12. Ref 1: Page Fault (PF 8), Evict 3 (LRU), Frames: [4,6,7,1][4, 6, 7, 1]

  13. Ref 5: Page Fault (PF 9), Evict 4 (LRU), Frames: [6,7,1,5][6, 7, 1, 5]

  14. Ref 6: Hit, Frames: [7,1,5,6][7, 1, 5, 6]

  15. Ref 1: Hit, Frames: [7,5,6,1][7, 5, 6, 1]

  • Total memory accesses = 1515

  • Total page faults = 99

Page Fault Rate=Number of Page FaultsTotal Accesses=915=0.6\text{Page Fault Rate} = \frac{\text{Number of Page Faults}}{\text{Total Accesses}} = \frac{9}{15} = 0.6

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 Q64 of the GATE CSE 2022 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 2022 has 2.

How GATE tests Memory Management and Virtual Memory

More from GATE CSE 2022

Share this solution

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

GateAI solution cardGATE CSE 2022 · Q64 · NAT

Consider a demand paging system with four page frames (initially empty) and LRU page replacement policy. For the following page reference string 7, 2, 7, 3, 2, 5, 3, 4, 6, 7, 7, 1, 5, 6, 1 the page fault rate, defined as the ratio of number of page faults to the number of memory accesses (rounded off to one decimal place) 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.