2

Optimal Page Replacement Algorithm in Operating Systems

 2 years ago
source link: https://www.geeksforgeeks.org/videos/optimal-page-replacement-algorithm-in-os/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Optimal Page Replacement Algorithm in Operating Systems

Optimal Page Replacement Algorithm in Operating Systems
  • 27/06/2022

In this video, we will be learning about one of the Page replacement's algorithms i.e Optimal Page Replacement algorithm.

Let us first understand, what is page replacement?

Page Replacement is the process of bringing a page from the secondary memory to the main memory by replacing a page existing in the main memory. Page Replacement is required if the Operating System uses Virtual Memory and Demand Paging for memory management.

Page Replacement (PR) algorithms decide which page will be removed from the main memory for bringing a new page in place of it. Different PR algorithms follow different strategies for selecting which page to replace so as to minimize the number of page faults.

Page Replacement is required due to the limited size of the main memory. Since the main memory is smaller than the virtual memory, a finite number of pages can be present in the main memory at any time. When the CPU requests a page that is not present in the memory, it leads to a page fault. To handle the page fault, OS brings the requested page from the secondary memory to the main memory.

In an optimal page replacement algorithm, the OS replaces the page that will not be used for the longest time in the future. Among all the pages present in the memory, the page that will be referred to at the farthest time is the one that will be replaced by this algorithm. This algorithm makes decisions by looking into future usage. The Operating System must be able to foresee the requirement of a page for proper implementation of this algorithm.

The optimal Page Replacement algorithm leads to the minimum number of page faults as compared to other algorithms. It is easy to understand It improves the overall performance of a computer system and has low complexity. Makes use of simple data structures. It needs a track of future requirements of pages which is not possible. Error handling is difficult in the optimal page replacement algorithm.

Optimal Page Replacement Algorithm: https://www.geeksforgeeks.org/optimal-page-replacement-algorithm/


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK