GATE / CS ARCHIVE

GATE CSE 2015 SET 1 / QUESTION 57

GATE CSE 2015 Set 1 Q57

Operating Systems · Virtual Memory & Paging · Full GATE CSE 2015 Set 1 paper

GATE 2015 Set 1, Q57 2 marks · MCQ
Report issue

Virtual Memory & Paging

Question 57, GATE 2015: Five initially empty page frames receive 3,8,2,3,9,1,6,3,8,9,3,6,2,1,3. Compare FIFO and LRU faults. A same; B FIFO has two more; C LRU has two more; D FIFO has one more.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step through it (2 policies)

After filling with 3,8,2,9,1, FIFO removes 3 for 6, then 8 for 3, then 2 for 8; the repeated hits do not change its queue. LRU updates recency at every hit, so it evicts 8 when 6 arrives, then 2 when 8 returns. Continuing through the full sequence gives nine faults for each, although different victims and fault positions occur. Equal totals in this example do not imply the policies behave identically or have equal performance on all strings.

Solution: Starting with empty frames, FIFO faults at reference positions 1, 2, 3, 5, 6, 7, 8, 9, 13; LRU faults at 1, 2, 3, 5, 6, 7, 9, 13, 14. Each has 9 faults, though at different references. Thus A. The simulation updates LRU recency on hits but does not change FIFO insertion order on hits.

Original paper, page 21 · Answer key