Introduction

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.Let's have a look at an example for better understanding.


Example

Consider page reference string 1, 3, 0, 3, 5, 6 with 3 page frames.Find number of page faults.
1) Initially all slots are empty, so when 1, 3, 0 came they are allocated to the empty slots —> 3 Page Faults.
2) When 3 comes, it is already in memory so —> 0 Page Faults.
3) Then 5 comes, it is not available in memory so it replaces the oldest page slot i.e 1. —> 1 Page Fault.
4) 6 comes, it is also not available in memory so it replaces the oldest page slot i.e 3 —> 1 Page Fault.
5) Finally when 3 come it is not avilable so it replaces 0 -> 1 page fault.

Learn More

Page Replacement Algorithms






Click Below for Live Simulation