Introduction
Imagine your computer's memory is full, but it needs to load new information. It must decide which old information to remove to make space. Page replacement algorithms help the computer choose which data to remove when memory is full.
Imagine a small desk with limited space for books. FIFO means you remove the book you placed first, no matter if you still need it. LRU means you remove the book you haven't looked at for the longest time. Optimal means you magically know which book you won't need for the longest time and remove that one.
┌───────────────┐ │ Memory Frames │ ├───────────────┤ │ FIFO │ │ ┌───────────┐ │ │ │ Oldest │ │ │ │ page out │ │ │ └───────────┘ │ ├───────────────┤ │ LRU │ │ ┌───────────┐ │ │ │ Least │ │ │ │ recently │ │ │ │ used page │ │ │ └───────────┘ │ ├───────────────┤ │ Optimal │ │ ┌───────────┐ │ │ │ Future │ │ │ │ longest │ │ │ │ unused │ │ │ │ page out │ │ │ └───────────┘ │ └───────────────┘