Eviction Policies

FIFO Eviction

Belady’s Anomaly

Optimal Page Replacement

LRU Page Replacement

LRU can give the worst possible result

Implementations

  1. Stamp entries with timer value
    • Scan pages to find oldest value
    • Expensive
  2. Keep doubly linked list of pages
    • Also expensive
      Use Approximate LRU

Clock Algorithm

Pasted image 20231209173541.png
Use accessed bit to keep track of entries

  1. If page’s A bit = 1
  2. then set to 0 and skip
  3. else evict
    Pasted image 20231209174358.png
    Add a second clock hand

Random eviction