Least Recently Used (LRU) Page Replacement Algorithm in Operating Systems (OS)

Least Recently Used (LRU) Page Replacement Algorithm in Operating Systems (OS)?

LRU Page Replacement Algorithm works on a prediction that the pages that have been used more times in the last few instructions will probably be used again and again.

Least Recently Used algorithm page replacement operating systems OS
Figure: Least Recently Used algorithm page replacement operating systems OS

PF stands for the page fault.  Read More  FH is used in the table to represent the page hit. Read More Read More 

1st column: First of all, all memory is free.

2nd column: Page 4 is loaded on memory. The page fault occurs because page 4 is already not on memory.

3rd column: Page 6 is loaded on memory. The page fault occurs.

4th column: Page 8 is loaded on memory. The page fault occurs.

5th column: Page 4 is already loaded on memory. Page Hit occurs.

6th column: Page 2 is loaded on memory. The page fault occurs.

7th column: Page 6 is loaded on memory. The page fault  Read More  occurs.