1837650 Members
2919 Online
110117 Solutions
New Discussion

Paging and swapping

 
Krishnan Viswanathan
Frequent Advisor

Paging and swapping

"vmstat" indicates that there was 1 process paged out. "sar" indicated current swap in/swap outs.
what is the basic difference between "pages out" and "swapout" ?
also is it possible to find out which specific processes were/are "paged" out and "swapped" out ?

Thanks
7 REPLIES 7
Paula J Frazer-Campbell
Honored Contributor

Re: Paging and swapping

Hi
Even if your momory is noever fully used some paging will occur of memory mapped files.

This may help:-
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x60a572234586d5118ff00090279cd0f9,00.html


Paula
If you can spell SysAdmin then you is one - anon
James R. Ferguson
Acclaimed Contributor

Re: Paging and swapping

Hi:

Swapping" actually refers to an old(er) memory managment 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.

Loosely, the terms "swapping" and "paging" are sometimes used interchangably.

Regards!

...JRF...
Krishnan Viswanathan
Frequent Advisor

Re: Paging and swapping

James,

Thanks so much for the clarification. I have cleared the kernel accumlation for vmstat. Now vmstat does not report any paging activity. However, sar shows swap out/swap in.
Does it mean that swapping concept overrules paging ? also is there a way to find out which specific process was swapped out /

thanks again
Krishnan Viswanathan
Frequent Advisor

Re: Paging and swapping

Okay, thanks all. Now the only clarification needed is how to find out which specific process (PID) is being swapped/paged out to disk.
Thanks again
Sridhar Bhaskarla
Honored Contributor

Re: Paging and swapping

Hi Krishnan,

The differentiation between paging and swapping is arguable. However, the pageouts that we see may not truly indicate a bottleneck. But swapouts do.

It actually depends on three paging thresholds.

lotsfree: There may be a lot of free memory pages and it is the upper bound below which the paging will not occur.

desfree: This is the number of free pages desired. This is actually the limit where the pageouts will begin. This is the lower bound to page outs.

minfree: The minimum amount of free pages. If the memory available falls below this line, it indicates thrashing and you can see the entire processes getting deactivated. And this is usually termed as swapping outs.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
T. M. Louah
Esteemed Contributor

Re: Paging and swapping

Suggestion: best metering tool use GLANCE !
bigbox:root:> vmstat -s
31 swap ins
31 swap outs
0 pages swapped in
0 pages swapped out
32200473601 total address trans. faults taken
9046413 page ins
25009 page outs
226305 pages paged in
84913 pages paged out

Pageouts can happen for two reasons :-

1) System is experiencing memory pressure and as a result vhand is paging
out memory pages to make room for other processes. This is the pageout
activity that we do NOT want to see since a high pageout rate may in
this case may lead to memory bottlenecks and hence poor performance.

2) Pages could also be paged out as a result of applications using memory
mapped files via mmap() / munmap() / msync() or a mix between these and
read() / write() calls. Unfortunately such user pageout activity is
also reported in the "Paged Out" metric in glance and the equivalent
'po' column in vmstat.

Little learning is dangerous!