Frame Allocation
How does the OS decide how many frames to initially give to each process?
This depends on the frame allocation policy of the particular operating system.
- The smallest number of frames that the OS must allocate to a process dependents on system architecture.
- Usually, this number will be the largest number of pages that could be accessed by a single instruction.
- When an instruction uses indirect access (pointer to a variable), several pages might be accessed.
- Algorithms that the OS could use to decide how to allocate frames are:
- Equal Allocation: If there are m frames available and n processes to share them, each process gets m / n frames, and the leftovers are kept in a free-frame buffer pool.
- Proportional Allocation: Allocate the frames proportionally to the size (or prioroty) of the process, relative to the total size of all processes. So if the size of process p is Sp, and S is the sum of all Sp, then the allocation for process p is: (m * Sp / S) frames.