Suppose for a process P, reference to pages in order are 1, 2, 4, 5, 2, 1, 2, 4. Assume that main memory can accommodate 3 pages and the main memory has already pages 1 and 2 in the order 1 - first, 2 - second. At this moment, assume FIFO Page Replacement Algorithm is used then the number of page faults that occur to complete the execution of process P is
5
The initial FIFO queue is [1,2], oldest first. Hits do not change FIFO order.
| Reference | Hit/fault | Queue after reference |
|---|---|---|
| 1 | Hit | 1,2 |
| 2 | Hit | 1,2 |
| 4 | Fault | 1,2,4 |
| 5 | Fault | 2,4,5 |
| 2 | Hit | 2,4,5 |
| 1 | Fault | 4,5,1 |
| 2 | Fault | 5,1,2 |
| 4 | Fault | 1,2,4 |
There are five page faults, at reference positions 3, 4, 6, 7 and 8.
Consider a virtual page reference string 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0,1, 7, 0,1 Suppose a demand paged virtual memory system running on a computer system such that the main memory has 3 page frames. Then_______ page replacement algorithm has minimum number of page faults.
For the following page reference string 4, 3, 2, 1, 4, 3, 5, 4, 3, 2, 1, 5. the number of page faults that occur in Least Recently Used (LRU) page replacement algorithm with frame size 3 is