PAGE REPLACEMENT

Includes:

Downward Arrow

About

In a computer operating system that uses paging for virtual memory management, page replacement algorithms decide which memory pages to page out, sometimes called swap out, or write to disk, when a page of memory needs to be allocated.

Page replacement happens when a requested page is not in memory (page fault) and a free page cannot be used to satisfy the allocation, either because there are none, or because the number of free pages is lower than some threshold

Page Replacement is important because:

1. It helps the OS to decide which memory page can be moved out, making space for the currently needed page.

2. The ultimate objective of all page replacement algorithms is to reduce the number of page faults.

Important term for page replacement:

Page fault:

A page fault occurs when a program attempts to access a block of memory that is not stored in the physical memory, or RAM.

The fault notifies the operating system that it must locate the data in virtual memory, then transfer it from the storage device, such as an HDD or SSD, to the system RAM.

Algorithms

FIFO

During replacement the oldest page is replaced by the new page.

LIFO

During replacement the top most page in the stack is replaced first.

LRU

The least reffered page is replaced by the new page.

OPTIMAL

The page which is not going to be used in future will be replaced by the new page.

RANDOM

A page is randomly selected to get replaced by the new page.

BELADY

On increasing the no of frames the page faults also increases.