|Department of Computer Science |
Course: CS 3725
This is another method for varying the amount of physical memory available to a process. It is based on the simple observation that, when the frequency of page faults for a process increases above some threshold, then more memory should be allocated to the process.
The page fault frequency PFF) can be approximated by 1/(time between page faults), although a better estimate can be gotten by averaging over a few page faults.
A PFF implementation must both increase the number of pages if the PFF is higher than some threshold, and must also lower the number of pages in some way. A reasonable policy might be the following:
The thresholds and should be system parameters, depending on the amount of physical memory available.
An alternative policy for decreasing the number of pages allocated to a process might be to decrease the number of pages allocated to a process when the PFF does not exceed T for some period of time.
Note that in all the preceding we have implicitly assumed that pages will be loaded on demand -- this is called demand paging. It is also possible to attempt to predict what pages will be required in the future, and preload the pages in anticipation of their use. The penalty for a bad ``guess'' is high, however, since part of memory will be filled with ``useless'' information. Some systems do use preloading algorithms, but most present systems rely on demand paging.