GATE CS 2015 Set 1 — Question 57
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.MCQ+2 / -0.67MediumPage Replacement AlgorithmsMemory ManagementOperating System
Operating System → Memory Management → Page Replacement Algorithms
Last updated
Question
Consider a main memory with five page frames and the following sequence of page references: 3, 8, 2, 3, 9, 1, 6, 3, 8, 9, 3, 6, 2, 1, 3. Which one of the following is true with respect to page replacement policies First In First Out (FIFO) and Least Recently Used (LRU)?
Correct answer
(A) Both incur the same number of page faults
Solution
Reference String: 3, 8, 2, 3, 9, 1, 6, 3, 8, 9, 3, 6, 2, 1, 3
Frames: 5FIFO:
Stack (Right = MRU):
3 -> M [3]
8 -> M [3, 8]
2 -> M [3, 8, 2]
3 -> H [8, 2, 3]
9 -> M [8, 2, 3, 9]
1 -> M [8, 2, 3, 9, 1]
6 -> M (Evict 8) [2, 3, 9, 1, 6]
3 -> H [2, 9, 1, 6, 3]
8 -> M (Evict 2) [9, 1, 6, 3, 8]
9 -> H [1, 6, 3, 8, 9]
3 -> H [1, 6, 8, 9, 3]
6 -> H [1, 8, 9, 3, 6]
2 -> M (Evict 1) [8, 9, 3, 6, 2]
1 -> M (Evict 8) [9, 3, 6, 2, 1]
3 -> H [9, 6, 2, 1, 3]
Total LRU Faults = 9Both policies incur 9 page faults.
Frames: 5FIFO:
1.3: Miss [3]
2.8: Miss [3, 8]
3.2: Miss [3, 8, 2]
4.3: Hit
5.9: Miss [3, 8, 2, 9]
6.1: Miss [3, 8, 2, 9, 1] (Full)
7.6: Miss (Replace 3) -> [6, 8, 2, 9, 1]
8.3: Miss (Replace 8) -> [6, 3, 2, 9, 1]
9.8: Miss (Replace 2) -> [6, 3, 8, 9, 1]
10.9: Hit
11.3: Hit
12.6: Hit
13.2: Miss (Replace 9) -> [6, 3, 8, 2, 1]
14.1: Hit
15.3: Hit
Total FIFO Faults = 9LRU:1.3: Miss [3]
2.8: Miss [3, 8]
3.2: Miss [3, 8, 2]
4.3: Hit (Order: 8, 2, 3)
5.9: Miss [3, 8, 2, 9]
6.1: Miss [3, 8, 2, 9, 1]
7.6: Miss (Replace LRU 8? No, LRU is 8? Sequence so far: 3, 8, 2, 3, 9, 1. LRU stack: 1, 9, 3, 2, 8. 8 is LRU). -> [3, 6, 2, 9, 1]
8.3: Hit
9.8: Miss (Replace LRU 2) -> [3, 6, 8, 9, 1]
10.9: Hit
11.3: Hit
12.6: Hit
13.2: Miss (Replace LRU 1) -> [3, 6, 8, 9, 2]
14.1: Miss (Replace LRU 8) -> [3, 6, 1, 9, 2]
15.3: Hit
Let's re-trace LRU carefully:Stack (Right = MRU):
3 -> M [3]
8 -> M [3, 8]
2 -> M [3, 8, 2]
3 -> H [8, 2, 3]
9 -> M [8, 2, 3, 9]
1 -> M [8, 2, 3, 9, 1]
6 -> M (Evict 8) [2, 3, 9, 1, 6]
3 -> H [2, 9, 1, 6, 3]
8 -> M (Evict 2) [9, 1, 6, 3, 8]
9 -> H [1, 6, 3, 8, 9]
3 -> H [1, 6, 8, 9, 3]
6 -> H [1, 8, 9, 3, 6]
2 -> M (Evict 1) [8, 9, 3, 6, 2]
1 -> M (Evict 8) [9, 3, 6, 2, 1]
3 -> H [9, 6, 2, 1, 3]
Total LRU Faults = 9Both policies incur 9 page faults.
Continue learning with Success Tracker
A step still unclear? Work through it with support
Use Success Tracker to ask about the reasoning, then try another GATE CS question to check your understanding.
AI-powered practice· Unlimited practice on eligible plans
- PYQs with solutions
- Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
- Practice that adapts
- Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
- AI doubt support
- Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.
Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.
This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.
More questions on Memory Management
2026 Set 2 Q23Which one of the following CPU scheduling algorithms cannot be preemptive?2026 Set 1 Q29With respect to deadlocks in an operating system, which of the following statements is/are FALSE?2026 Set 1 Q31In the context of relational database normalization, which of the following statements is/are true?2026 Set 1 Q35Consider a system consisting of instances of a resource , being shared by 5 processes.…2026 Set 2 Q51Consider three processes P1, P2, and P3 running identical code, as shown in the pseudocode below. A…