System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

What is the difference between page-in & page-out and swap-in & swap-out

SOLVED
Go to solution
senthil_kumar_1
Super Advisor

What is the difference between page-in & page-out and swap-in & swap-out

Hi All,

I would like to know the difference between page-in & page-out and swap-in & swap-out.
5 REPLIES
Huc_1
Honored Contributor

Re: What is the difference between page-in & page-out and swap-in & swap-out

A good place to start is

http://en.wikipedia.org/wiki/Paging

there are many links there to follow up

Jean-Pierre Huc

Smile I will feel the difference
P Muralidhar Kini
Honored Contributor

Re: What is the difference between page-in & page-out and swap-in & swap-out

Solution

Re: What is the difference between page-in & page-out and swap-in & swap-out

Hi,

Split the address space needed to run your process into pages, they are called virtual pages. Now try to map the virtual pages into the physical memory you have. If you process bigger then you won't be able to map all your pages to physical pages.

No problem, page-in and page-out will help you. This is what paging aligorithm does.

Only the virtual pages needed to me mapped into physical memory are those which are needed are referenced by your process at any point of time.

Assume there are pages which stores data which can't be stored in the disk for example your static/global variables which modified. So when this pages are removed from physical memory they are paged out to a page file.

When you reference those variable again and they were earlier paged out you read them in .. i.e page-in.

Swap-in and swap-out involves when entire process memory is written something called swapfile.

I belive with the amount of physical memory we have now a days swap-in or swap-out happens very rarely.

-Regards,
Pramod.
Kranti Mahmud
Honored Contributor

Re: What is the difference between page-in & page-out and swap-in & swap-out

Hi Senthil,

page-out === The system's free memory is less than a threhsold "lotsfree" and vhand daemon used "LFU" algorithm to move some unused / least used pages to the swap area.

page-in === One process which is running requested for a page that is not in the current memory (page-fault), vhand daemon is bringing it's pages to memory.

swap-out === System is thrashing and swapper daemon has de-activated a process and it's memory pages are moved into the swap area.

swap-in === A deactivated process is back to work and it's pages are being brought into the memory.

Rgds-Kranti
Dont look BACK as U will miss something INFRONT!
Kranti Mahmud
Honored Contributor

Re: What is the difference between page-in & page-out and swap-in & swap-out

Hi Senthil,

swapin and swapout is used to swap files/devices to or from swap memory devices / location.
They are the counts of swap IO to do swaping of the files/devices operation to or from swap memory.

pagein and pageout are used for the Virtual Memory initiated IO and operation on file-system memory.
They are the counts for VMIO without considering where the operation is done at file-system memory or swap memory.

Rgds-Kranti
Dont look BACK as U will miss something INFRONT!