A system uses FIFO policy for page 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?
A system uses FIFO policy for page 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? Correct Answer 196
Key PointsConcept:
First In First Out (FIFO) :
This is the simplest page replacement algorithm. In this algorithm, the operating system keeps track of all pages in the memory in a queue, the oldest page is in the front of the queue. When a page needs to be replaced page in the front of the queue is selected for removal.
Solution:
Given that page frame size = 4
As there are 100 distinct pages which are first accessed → 100 page faults
when it accesses the same 100 pages but now in the reverse order → (100-4)
Because page frame size is four.
There fore, Total number of page faults = 100+ (100-4)= 196
Hence the correct answer is 196.