written 5.7 years ago by | • modified 5.7 years ago |
When a page fault occurs, page replacement algorithm are used for loading the page in memory and no free page frame exist in the memory.
Page fault occur if a running process reference a non resident page.
The goal of a page replacement strategy into minimize the fault rate, to evaluate a replacement algorithm, following parameter are used.
The size of page.
A set of reference strings.
The number of page frames.
Given there i/p, we can determine the number of page faults & hence the page fault rate.
When we find the page frame reference, is in the main memory that we have a page hit and when page fault occurs we say it is page miss.
Page replacement algorithm deals with how the kennel decides which page reclaim operating system selects the local or global page replacement policy.
Following are different page replacement policies
FIFO
LRU
Optimal page replacement.
FIFO page replacement algorithm removes the page that have been in memory, the length.
The system keeps track of the order in which pages enter the primary memory.
LRO stands for learnt recently used. This replacement policy chooses to replace the page which has not been referenced for the length time.
This policy assumes the recent pass will approximate the immediate future, OS keel tracks of when each page was referenced by recording the time of reference or by maintaining a stock of references.
In optimal page replacement policy algorithm, the data which will not be accessed permanently or for a longer time should be replaced, optimal page replacement algorithm gives less page fault as compared to FIFO & LRU.
The key distinction between FIFO & optimal is that FIFO uses the time when a page is brought into memory where as optimal uses the time when a page is to be used.
Optimal page replacement policy is difficult to implement because of future reference.