Bird
Raised Fist0

In a system with very limited memory (only 2 frames) and a reference string with frequent repeated accesses to a small set of pages, which algorithm is generally better and why?

hard⚖️ Approach Comparison Q8 of Q15
Operating Systems - Page Replacement - FIFO, LRU, Optimal Algorithm
In a system with very limited memory (only 2 frames) and a reference string with frequent repeated accesses to a small set of pages, which algorithm is generally better and why?
AOptimal, because it perfectly predicts future accesses and minimizes faults
BLRU, because it keeps recently used pages which are likely to be reused soon
CRandom replacement, because it avoids overhead of tracking usage
DFIFO, because its simplicity reduces overhead in constrained memory
Step-by-Step Solution
Solution:
  1. Step 1: Consider memory constraints and access pattern

    With only 2 frames and frequent repeated accesses, LRU keeps recently used pages, reducing faults. Optimal is ideal but impractical. FIFO ignores usage, causing more faults. Random is unpredictable.
  2. Final Answer:

    Option B -> Option B
  3. Quick Check:

    LRU suits small memory with locality [OK]
Quick Trick: LRU excels with small memory and locality [OK]
Common Mistakes:
MISTAKES
  • Assuming Optimal is always practical
  • Choosing FIFO for simplicity over fault rate
  • Ignoring benefits of usage tracking
Trap Explanation:
PITFALL
  • Candidates may pick Optimal ignoring practicality or FIFO ignoring fault impact.
Interviewer Note:
CONTEXT
  • Tests ability to apply algorithms to constrained resource scenarios.
Master "Page Replacement - FIFO, LRU, Optimal Algorithm" in Operating Systems

2 interactive learning modes - each teaches the same concept differently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Operating Systems Quizzes