Search This Blog

Sunday, July 3, 2011

Difference between Paging & Swapping

"Swapping" actually refers to an old(er) memory management mechanism wherein all "pages" of a process where rolled-out to disk when memory needed to be freed.
"Paging" is the modern, more sophisticated mechanism wherein pages of memory are aged over time and so moved to disk as they become unused. Paging imposes much less overhead than the all-or-none swapping.

In HP-UX, you have "swap" space, but in the modern versions HP is doing paging, using the swap space.
Process of paging and swapping are interchangeably used.
But there is a difference between then:

1. Paging : Is the process of removing only one page from virtual space into physical memory and this is called "Page in", and removing only one page from physical memory into the virtual space and this is called "page out".

2. Swapping: Is the process of removing all of a process's pages from physical memory to virtual space and called "Swap out", and removing all of a process's pages from virtual space to physical memory and it is called "Swap in".


Conclusion:
Paging: Only one page.
Swapping: the entire pages belonging to a process.

No comments:

Post a Comment