Frame-Allocation Algorithms - to decide how many frames to allocate to each process
Goal: Allocate enough frames to keep all pages used in the current locality of references without allocating too many page frames.
The OS might maintain a pool of free frames in a free-frame list.
Allocation Policies:
1) local page replacement - When process A page faults, consider only replacing pages allocated to process A. Processes are allocated a fixed fraction of the page frames.
2) global-page replacement - When a page fault occurs, consider replacing pages from any process in memory. Page frames are dynamically allocated among processes, i.e., # of page frames of a process varies.
Advantage: as a process' working set grows and shrinks it can be allocated more or less page frames accordingly.
Disadvantage: a process might be replacing a page in the locality of reference for another process. Thrashing is more of a problem in systems that allow global-page replacement.
Implementation of global-page replacement
a) Page-Fault Frequency - OS monitors page-fault rate of each process to decide if it has too many or not enough page frames allocated