S2: LRU page replacement algorithm suffer from Belady’s anomaly .
Which of the following is CORRECT?
Correct : B
Given:
Two statements regarding Belady's anomaly:
S1: Random page replacement algorithm suffers from Belady’s anomaly.
S2: LRU page replacement algorithm suffers from Belady’s anomaly.
To find:
Which of the statements S1 and S2 are correct.
Solution:
Let me check statement S2 first.
A page replacement algorithm is free from Belady's anomaly if it belongs to the class of stack algorithms.
For a stack algorithm, the set of pages in memory for n frames is always a subset of the pages in memory for n + 1 frames.
Since LRU (Least Recently Used) is a stack algorithm, it can never suffer from Belady's anomaly.
So, statement S2 is false.
Now let me check statement S1.
The Random page replacement algorithm randomly picks a page to replace.
Because of this random choice, it does not satisfy the inclusion property of stack algorithms.
Since it is not a stack algorithm, it can exhibit Belady's anomaly where increasing the number of frames leads to more page faults.
So, statement S1 is true.
Therefore, S1 is true and S2 is false.
Answer: (B) S1 is true, S2 is false
Similar Questions
Total Unique Visitors