What is the difference between Swapping and Paging?

Swapping : Whole process is moved 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 overhead to the system.
  • Swapping systems does not handle the  memory more flexibly as compared to the paging systems.

 

Paging : Only the required memory pages are moved to main memory from the swap device for execution. Process size does not matter.
  • Gives the concept of the virtual memory.
  • 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.
  • Demand paging systems handle the memory more flexibly.

The Purpose Of Swapping

So, we can say that the purpose of swapping, or paging, is to access data being stored in hard disk and to bring it into the RAM so that it can be used by the application program. Remember that swapping is only necessary when that data is not already in the RAM.

Excessive Swapping Causes Thrashing

Excessive use of swapping is called thrashing and is undesirable because it lowers overall system performance, mainly because hard drives are far slower than RAM.