Homework-8 Version 0 |
|
👤 Author: by 59739640qqcom 2019-11-28 02:23:10 |
In Virtual memory management, demostrate one of the page replacement algorithms.
Optimal Page Replacement
An optimal page-replacement algorithm has the lowest page-fault rate of all algorithms and will never suffer from Belady's anomaly.Such an algorithm does exist and has been called OPT or MIN.It is simply this:
Replace the page that will not be used
for the longest period of time
use of this page-replacement algorithm guarantees the lowest possible page-fault rate for a fixed number of frames.
For example :
we get a reference string :7 0 1 2 0 3 0 4 2 3 2 1 2 0.....
and our page has 3 frames
first we can fill the three empty frames with 7 0 1
and then we should traverse the string and we can find a reference that will not be used for the longest period of time is:7
so the second step is convert the first frame to 2...
So as we mentioned above , the most important point of this Page Replacement algorithm is that , we have to predict the future
and then it can find the most useless resource in the future. It's a difficult and too idealized method.