0
1.0kviews
Write short note on Beladys anomaly
1 Answer
written 3.0 years ago by | • modified 3.0 years ago |
FIFO Page Replacement Algorithm
Random Page Replacement Algorithm
Second Chance Algorithm
LRU Page Replacement Algorithm
Optimal Page Replacement Algorithm
Because these algorithms follow stack properties and are also called stack-based page replacement algorithms. Hence, they do not suffer from Belady’s Anomaly.
Consider String = 0, 1, 2, 3, 0, 1, 4, 0, 1, 2, 3, 4
For Frame size = 3
String | 0 | 1 | 2 | 3 | 0 | 1 | 4 | 0 | 1 | 2 | 3 | 4 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Frame 3 | 2 | 2 | 2 | 1 | 1 | 1 | 1 | 1 | 3 | 3 | ||
Frame 2 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 2 | |
Frame 1 | 0 | 0 | 0 | 3 | 3 | 3 | 4 | 4 | 4 | 4 | 4 | 4 |
Hit/Miss | M | M | M | M | M | M | M | H | H | M | M | H |
Number of Page Faults = 9
For Frame Size = 4
String | 0 | 1 | 2 | 3 | 0 | 1 | 4 | 0 | 1 | 2 | 3 | 4 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Frame 4 | 3 | 3 | 3 | 3 | 3 | 3 | 2 | 2 | 2 | |||
Frame 3 | 2 | 2 | 2 | 2 | 2 | 2 | 1 | 1 | 1 | 1 | ||
Frame 2 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 4 | |
Frame 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 4 | 4 | 4 | 3 | 3 |
Hit/Miss | M | M | M | M | H | H | M | M | M | M | M | M |
Number of Page Faults = 10
Above Example of FIFO shows that count of page faults increase when the number of frames is increased from 3 to 4.