13 Dec 2019

  • December 13, 2019
  • Amitraj
Allocation of frames


When a page fault occurs, there is a free frame available to store a new page into a frame. While the page swap is taking place, a replacement can be selected, which is written to the disk as the user process continues to execute. The operating system allocates all its buffer and tablespace from the free-frame list for the new page.


Two major allocation Algorithm/schemes.

1. Equal allocation
2. Proportional allocation



Equal allocation:  
The easiest way to split m frames among n processes is to give everyone an equal share, m/n frames. This is known as equal allocation.



proportional allocation: 
Here, it allocates available memory to each process according to its size. Let the size of the virtual memory for process pi be si, and define S= ∑ Si

Then, if the total number of available frames is m, we allocate ai frames to process pi, where ai is approximately   ai = Si/ S x m.




Global v/s Local Allocation
We can classify page-replacement algorithms into two broad categories: global replacement and local replacement.

Global replacement allows a process to select a replacement frame from the set of all frames, even if that frame is currently allocated to some other process; one process can take a frame from another.

Local replacement requires that each process selects from only its own set of allocated frames.


Translate

Popular Posts