Explain Swapping In Operating System. Paging is a storage mechanism that allows os to retrieve processes from the secondary storage into the main memory in the form of pages. Swapping is a mechanism in which a process can be swapped temporarily out of main memory (or move) to secondary storage (disk) and make that memory available to other processes.

Swapping allows multiple programs to run parallelly in the operating system. The biggest advantage of paging is that it is easy to use memory management algorithm. Similarly when ram is free, then we again swap in the programs from hard disk to ram.