Virtual Memory
Could bring a page into memory only when it is needed
Advantages:
局部性原理
Rule
Implementation
Belady’s Anomaly For some page-replacement algorithms, the page-fault rate may increase as the number of allocated frames increases.
Adding more frames might cause more page faults!
Replace the page that will not be used for longest period of reference string
Problem
Replace page that has not been used in the most amount of time
Disadvantage
Keep a stack of page numbers in a double link form:
When a page referenced:
Usage of a reference bit
Second-chance algorithm
Improve algorithm by using reference bit and modify bit for each page in memory
All pages in memory fall into four classes
When page replacement called for, replace page in lowest nonempty class in clock scheme
More strategies (algorithms) in improving the efficiency of page replacement
Page-buffering consideration
Keep a pool of free frames always
Expansion
For performance reason, each process needs minimum number of frames
系统颠簸
If a process does not have “enough” frames in memory, the page-fault rate is very high
Advantage: