Difference between Paging and Swapping in OS

Swapping:
Swapping is a process of swapping a process temporarily to a secondary memory from main memory which is fast as compared to secondary memory. But as RAM is of less size so the process that is inactive is transferred to secondary memory. The main part of swapping is transferred time and the total time directly proportional to the amount of memory swapped.

Paging:
Paging is the procedure of memory allocation where different non-contiguous blocks of memory are assigned a fixed size. The size is generally of 4KB. The paging is always performed between active pages.




Difference between Paging and Swapping :

Swapping Paging
It is procedure of copying out the entire process. It is a technique of memory allocation.
Swapping occurs when whole process is transferred to disk. Paging occurs when some part of process is transferres to disk.
In this process is swapped temporarily from main memory to secondary memory. In this the contiguous block of memory is made non-contiguous but of fixed size called frame or pages.
Swapping can be performed without any memory management. Non-contiguous Memory Management.
Swapping is done by inactive processes. Only active process can perform paging.
It provides the direction regarding the solution. No suggestion is given regarding the solution in it.

GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.