Skip to content
Official PYQ · 2017

GATE CS 2017 Set 1 Q40 — Memory Management and Virtual Memory

Explain with AI

Recall that Belady's anomaly is that the page-fault rate may increase as the number of allocated frames increases. Now, consider the following statements:

  • S1S_1: Random page replacement algorithm (where a page chosen at random is replaced) suffers from Belady's anomaly.
  • S2S_2: LRU page replacement algorithm suffers from Belady's anomaly.

Which of the following is CORRECT?

Choose one option
View worked solution

Answer: B

To determine which statements are correct, let us analyze the properties of the page replacement algorithms with respect to Belady's anomaly.

1. Stack Algorithms and Belady's Anomaly

A page replacement algorithm is called a stack algorithm if the set of pages in memory for nn frames is always a subset of the set of pages in memory for n+1n+1 frames, for any given page reference string. Stack algorithms never suffer from Belady's anomaly.

2. Analyzing Statement S2S_2 (LRU)

  • Least Recently Used (LRU) is a well-known stack algorithm.
  • At any point in time, the nn pages in memory for an nn-frame system are the nn most recently referenced pages, which is always a subset of the n+1n+1 most recently referenced pages in an (n+1)(n+1)-frame system.
  • Since LRU is a stack algorithm, it does not suffer from Belady's anomaly. Thus, S2S_2 is false.

3. Analyzing Statement S1S_1 (Random)

  • The Random page replacement algorithm selects a page to evict uniformly at random.
  • Because the replacement decisions are non-deterministic and do not depend on the recency or frequency of access, it does not satisfy the stack property.
  • Since it is not a stack algorithm, there exist reference strings and sequences of random choices where increasing the number of frames leads to more page faults. Thus, Random page replacement suffers from Belady's anomaly. Therefore, S1S_1 is true.

Hence, S1S_1 is true and S2S_2 is false, which corresponds to Option B.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Memory Management and Virtual Memory questions