Anonymous user menu

main memory with five page frames and the following sequence of page references :GATE-2015

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

Answer

 

ANS-A
3, 8, 2, 3, 9, 1, 6, 3, 8, 9, 3, 6, 2, 1, 3

In both FIFO and LRU, we get following after considering 3, 8, 2, 3, 9, 1, 3 8 2 9 1

3 8 2 9 1

FIFO 6 replaces 3

6 8 2 9 1  

3 replaces 8

6 3 2 9 1 

8 replaces 2

6 3 8 9 1  

2 replaces 9

 6 3 8 2 1

No more page faults

LRU

3 8 2 9 1

LRU 6 replaces 8

3  6 2 9 1

8 replaces 2

3 6 8 9 1

2 replaces 1

3  6 8 9 2

1 replaces 8

3  6  1 9 2

Both 9 page fault
 

1Comment
Mohit Lalwani @monty12
11 Feb 2016 07:06 pm

parallel lines denote Hits,...................................... .  both FIFO and LRU page faults...=9