GATE / CS ARCHIVE

SIMILAR QUESTIONS / OPERATING SYSTEMS

Recognize FIFO page replacement anomaly

5 questions solved the same way, newest first. Back to Operating Systems

How these are solved

Each tests that more frames can increase FIFO page faults. Some name the anomaly and ask the policy, another gives FIFO and asks the possible change;

1 mark · MCQ
Report issue

Virtual Memory & Paging

Question 20, GATE 2016: Which page-replacement policy can suffer a higher page-fault rate when more frames are allocated? A LRU; B OPT; C MRU; D FIFO.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

FIFO exhibits Belady’s anomaly. For reference string 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5, FIFO produces 9 faults with 3 frames but 10 with 4. LRU and OPT obey inclusion/optimality monotonicity; MRU is also an inclusion policy under consistent recency/tie handling. Thus D.

With three FIFO frames the example’s fault positions are 1,2,3,4,5,6,7,10,11. With four they are 1,2,3,4,7,8,9,10,11,12. More capacity changes eviction order, not merely how many pages fit at one instant. The inclusion property prevents this anomaly when every smaller resident set is contained in the larger one.

Original paper, page 30 · Answer key

1 mark · MCQ
Report issue

Belady anomaly policy

Virtual Memory & Paging

Question 9, GATE 2009: For which listed page replacement policy may Belady’s anomaly occur? A FIFO; B optimal; C LRU; D MRU.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

FIFO can incur more faults with more frames: the standard reference string 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5 has 9 faults with 3 frames and 10 with 4. LRU and optimal replacement have the stack-inclusion property; ordinary MRU also preserves inclusion for nested initially empty caches. Thus FIFO is the supplied policy exhibiting the anomaly, A.

FIFO can evict a page because it arrived long ago even if it will be reused immediately; adding frames changes that queue order and can increase faults. The classic reference string 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5 produces 9 FIFO faults with three frames and 10 with four. LRU and optimal have the inclusion/stack property that prevents this anomaly. The intended listed answer is FIFO; the baseline qualification concerning the exact MRU model remains important.

Original paper, page 2

1 mark · MCQ
Report issue

FIFO page replacement and additional frames

Virtual Memory & Paging

Question 1.21, GATE 2001: With FIFO page replacement, what can increasing the number of frames do for an arbitrary reference string: always decrease faults, always increase faults, sometimes increase faults, or never change faults?
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Step 1: FIFO evicts the page loaded earliest, without maintaining the stack-inclusion property of LRU. Adding frames can change future FIFO victim order.

Step 2: For reference string 1,2,3,4,1,2,5,1,2,3,4,5 from empty memory, FIFO incurs 9 faults with 3 frames but 10 with 4. This is Belady’s anomaly. Other strings can benefit or show no change.

Therefore additional frames can sometimes increase faults, C; neither a universal decrease nor universal increase is valid.

Original paper, page 3

1 mark · MCQ
Report issue

Belady’s anomaly

Virtual Memory & Paging

Question 1.8, GATE 1995: Which replacement policy can have more page faults after increasing the frame count: OPT, LRU, FIFO, or OPT and FIFO?
Tap to enlarge
Your answer
Answer & solution

Answer: C: FIFO (no official key was published)

FIFO removes the page that has been resident longest, independent of recent use or future demand. Its resident sets with different frame counts need not be nested, so adding a frame can alter the eviction order disadvantageously. The classic string 1,2,3,4,1,2,5,1,2,3,4,5 gives nine FIFO faults with three frames and ten with four. LRU and OPT have the stack-inclusion property and do not suffer this anomaly. Therefore C is the correct policy.

Original paper, page 1

Descriptive
Report issue

More frames can mean more faults

Virtual Memory & Paging

Question 3(v), GATE 1992: Which page-replacement policy can have more faults when memory size increases?
Question 3(v), GATE 1992: Which page-replacement policy can have more faults when memory size increases?
Tap to enlarge
Answer & solution

Answer: FIFO: Belady’s anomaly (no official key was published)

FIFO evicts the page loaded earliest, not necessarily the least useful page. With different frame counts, the order of subsequent evictions can change so that the larger memory performs worse. For example the reference string 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5 has nine FIFO faults with three frames but ten with four. LRU and optimal replacement have the stack-inclusion property and avoid this anomaly. The question asks for a policy that sometimes exhibits it, not a claim that adding frames always hurts FIFO.

Original paper, page 5