Javatpoint Logo
Javatpoint Logo

GATE 2015 question on LRU and FIFO

Q. Consider a main memory with five page frames and the following sequence of page references: 3, 8, 2, 3, 9, 1, 6, 3, 8, 9, 3, 6, 2, 1, 3. which one of the following is true with respect to page replacement policies First-In-First-out (FIFO) and Least Recently Used (LRU)?

A. Both incur the same number of page faults
B. FIFO incurs 2 more page faults than LRU
C. LRU incurs 2 more page faults than FIFO
D. FIFO incurs 1 more page faults than LRU

Solution:

Number of frames = 5

FIFO

According to FIFO, the page which first comes in the memory will first goes out.


OS GATE 2015 question on FIFO

Number of Page Faults = 9
Number of hits = 6

LRU

According to LRU, the page which has not been requested for a long time will get replaced with the new one.


OS GATE 2015 question on LRU

Number of Page Faults = 9
Number of Hits = 6

The Number of page faults in both the cases is equal therefore the Answer is option (A).






Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


B.Tech / MCA