1
2.0kviews
Calculate the hit and miss using various page replacement policies LRU, OPT, FIFO for following sequence (page frame size 3) 4,7,3,0,1,7,3,8,5,4,5,3,4,7,534 state which one is best for above example?
1 Answer
2
66views

Given String Sequence - 4,7,3,0,1,7,3,8,5,4,5,3,4,7,5,3,4

Frame Size - 3

FIFO Page Replacement Algorithm

String 4 7 3 0 1 7 3 8 5 4 5 3 4 7 5 3 4
Frame 3 3 3 3 7 7 7 5 5 5 5 5 7 7 7 7
Frame 2 7 7 7 1 1 1 8 8 8 8 3 3 3 3 3 4
Frame 1 4 4 4 0 0 0 3 3 3 4 4 4 4 4 5 5 5
Miss/Hit M M M M M M M M M M H M H M M H M

Number of Page Faults in FIFO = 14

LRU Page Replacement Algorithm

String 4 7 3 0 1 7 3 8 5 4 5 3 4 7 5 3 4
Frame 3 3 3 3 7 7 7 5 5 5 5 5 7 7 7 4
Frame 2 7 7 7 1 1 1 8 8 8 8 3 3 3 5 5 5
Frame 1 4 4 4 0 0 0 3 3 3 4 4 4 4 4 4 3 3
Miss/Hit M M M M M M M M M M H M H M M M M

Number of Page Faults in LRU = 15

Optimal Page Replacement Algorithm

String 4 7 3 0 1 7 3 8 5 4 5 3 4 7 5 3 4
Frame 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
Frame 2 7 7 7 7 7 7 7 7 4 4 4 4 7 7 7 4
Frame 1 4 4 4 0 1 1 1 8 5 5 5 5 5 5 5 5 5
Miss/Hit M M M M M H H M M M H H H M H H M

Number of Page Faults in Optimal Page Replacement Algorithm = 10

Because of a Low Number of Page Faults, Optimal Page Replacement Algorithm works better for the above example.

Please log in to add an answer.