A system uses FIFO policy for system replacement. It has $4$ page frames with no pages loaded to begin with. The system first accesses $100$ distinct pages in some order and then accesses the same $100$ pages but now in the reverse order. How many page faults will occur?
Answer is (A). When we access $100$ distinct page in some order (for example $1,2,3\ldots 100$) then total number of page faults $=100$. At last, the $4$ page frames will contain the pages $100,99,98$ and $97$. When we reverse the string $(100,99,98,\ldots,1)$ then first four page accesses will not cause the page fault because they are already present in page frames. But the remaining $96$ page accesses will cause $96$ page faults. So, total number of page faults $=100+96=196$.
$\text{Page fault} = 100 + 96\:\text{(reverse order)} = 196$
64.3k questions
77.9k answers
244k comments
80.0k users