Page Replacement Algorithms
When a new page is loaded into memory, and no free
page frame left:
- page replacement algorithm has to
be used to select a page frame
- write that selected page to the disk if the
page is dirty and update
any necessary tables
- Read the requested page from the disk
Three page replacement algorithms are simulated here:
- FIFO - First In First Out
Replace the page that has been in memory the longest
- The Principle of Optimality
Replace the page that will not be used again the farthest
time in the future.
- LRU - Least Recently Used
Replace the page that is used least often
Source Code
Simulation