Thursday, May 17, 2012

Swapping and Paging


To execute a process, atleast a part of the process must be contained in the primary memory(RAM) to run. The CPU cannot execute a process that exists entirely in secondary memory.

There are 2 memory management policies

  1. Swapping
  2. Paging

Swapping:

Swapping refers to writing the entire process, not just part, to disk from memory or the moving the entire process from the swap device to the main memory for execution. Process size must be less than or equal to the available main memory. It is easier to implementation and  swapping system does not handle the memory more flexibly as compared to the paging.

Paging:
Paging refers to writing portions, termed pages, of a process from memory to disk or moving only the required memory pages from swap device to main memory. Process size does not matter.

  • It provides greater flexibility in mapping the virtual address space into the physical memory of the machine. 
  • Allows more number of processes to fit in the main memory simultaneously. 
  • Allows the greater process size than the available physical memory. 


No comments:

Post a Comment