Optimal Page replacement Memory Management Operating Systems OS

Optimal Page replacement Memory Management Operating Systems OS

According to Optimal Page replacement OS replaces the page from the memory that is not used for a long period of time.

optimal page replacement algorithm operating systems
Figure: optimal page replacement algorithm operating systems

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

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

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

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

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

5th column: Page 4 is already loaded on memory. No page fault.

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

7th column: Page 6 is already loaded on memory. No page fault.  Read More 

C++ program to demonstrate the Optimal Page Replacement Algorithm

Output

optimal page replacement program in c++
Figure: optimal page replacement program in c++.
Fazal Rehman Shamil
Welcome to all friends. The reason for our success is only your love for T4Tutorials. Our team is always available to answer your queries regarding any kind of confusions or discussion regarding your study and career matters. For discussion with us please join our facebook group "T4Tutorials.com". The link of the group is mentioned below. Thanks and love to all for connecting with us. We are nothing without you. Love you all.....
https://web.facebook.com/groups/2066136233601097/