RANDOM

Downward Arrow

About

Random

As the name suggests, this algorithm randomly replaces any page. So, this algorithm may behave like any other algorithm like FIFO, LIFO, LRU, Optimal etc. It assumes the next page to be referenced is random and we can test other algorithms against random page replacement.


Advantages

  1. This eliminates the overhead cost of tracking page references.

  2. Usually it fares better than FIFO, and for looping memory references it is better than LRU, although generally LRU performs better in practice.

Disadvantages

  1. Can easily make "bad" choices by swapping out pages right before they are needed.

Algorithm

  1. When we need to evict a page, choose one randomly.

Implementation

Reference String:
Frames: