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:
- : Random page replacement algorithm (where a page chosen at random is replaced) suffers from Belady's anomaly.
- : LRU page replacement algorithm suffers from Belady's anomaly.
Which of the following is CORRECT?
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 frames is always a subset of the set of pages in memory for frames, for any given page reference string. Stack algorithms never suffer from Belady's anomaly.
2. Analyzing Statement (LRU)
- Least Recently Used (LRU) is a well-known stack algorithm.
- At any point in time, the pages in memory for an -frame system are the most recently referenced pages, which is always a subset of the most recently referenced pages in an -frame system.
- Since LRU is a stack algorithm, it does not suffer from Belady's anomaly. Thus, is false.
3. Analyzing Statement (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, is true.
Hence, is true and is false, which corresponds to Option B.
Free practice · Your answers on this page are not saved.
