Not Recently Used Page Replacement Algorithm
The not recently used abbreviated as NRU page replacement algorithm works on the subsequent principle: while a page is referenced, a referenced bit is set for that page, marking it as referenced. Likewise, while a page is modified (written to), a modified bit is set. At a specific fixed time interval, the clock interrupt triggers and clears the referenced bit of all the pages, thus only pages referenced in the current clock interval are marked with a referenced bit. When a page requires to be replaced, the operating system categorizes the pages into four classes:
a) Class 0: not referenced, not modified
b) Class 1: not referenced, modified
c) Class 2: referenced, not modified
d) Class 3: referenced, modified.
The NRU (Not recently used) algorithm picks a random page from the lowest category for removal.