The GATE Grind

GATE 2022 CS – Question 64

Operating System · Memory Management and Virtual Memory · 2 marks · Numerical answer

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 _________.

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: 0.6

Explanation

LRU, 4 frames. Reference string: 7, 2, 7, 3, 2, 5, 3, 4, 6, 7, 7, 1, 5, 6, 1.

RefFrames afterResult
77fault
27 2fault
77 2hit
37 2 3fault
27 2 3hit
57 2 3 5fault
37 2 3 5hit
42 3 5 4 (evict 7, least recent)fault
63 5 4 6 (evict 2)fault
73 4 6 7 (evict 5)fault
7samehit
14 6 7 1 (evict 3)fault
56 7 1 5 (evict 4)fault
6samehit
1samehit

Faults: 7, 2, 3, 5, 4, 6, 7, 1, 5 gives **9**. Rate $=9/15=\mathbf{0.6}$.

More Memory Management and Virtual Memory questions

All Memory Management and Virtual Memory questions →