# LRU vs FIFO page replacement

I am wondering if there is an instance where FIFO results in less page faults than LRU. For example:

2,6,5,7...


In this string, if I have to complete it by giving 3 additional terms, can I prove FIFO shows less page faults

I have proved how LRU can show less Page faults. But I cannot think of the initial problem statement solution. Any hints would really be great!

• Why do you put the constraint "by giving 3 additional terms"? Is this the original question? – xskxzr Feb 21 '19 at 12:12

## 1 Answer

For anyone visiting this thread in the future, FIFO can have less page faults in some scenarios.

In this one ( <2, 6, 5, 7, ..., ..., ...> ), it can be completed with 2, 8, 6.

The access of 2 means that the least recently used page is 6, but the first page in is still 2.

The access of 8 replaces 2 in FIFO, but 6 in LRU.

The access of 6, therefore, is a hit with FIFO, but a miss with LRU.