1745883 Members
4309 Online
108723 Solutions
New Discussion юеВ

Re: virtual and swap

 
himacs
Super Advisor

virtual and swap

Hi Admins,

I have heard that swap memory and virtual memory both are the same.
But why we use 2 different commands swapinfo and vmstat ?
I know that swap is part of HDD
but when virtual memory comes in to picture..

When idle processes are sent to swap from RAM and vice versa its called as pagein and pageout

But this p0 and pi status shown in vmstat not swapinfo

m really confused..plz help me


regards
himacs
6 REPLIES 6
Pete Randall
Outstanding Contributor

Re: virtual and swap

This is a good paper to start with:

http://docs.hp.com/en/5965-4641/ch01s02.html


Pete

Pete
Tingli
Esteemed Contributor

Re: virtual and swap

VM is a concept that increase the memory size the system can present than the real physical memory. Swap is a technique which fulfills this concept.
Dennis Handly
Acclaimed Contributor

Re: virtual and swap

swapinfo just defines how much swap and whether reserved or used.
vmstat gives more info on the current performance.
James R. Ferguson
Acclaimed Contributor

Re: virtual and swap

Hi Himacs:

To add to Dennis's comments, remember that every process has to "reserve" swap space so that it is available should the process ever need it (be paged out).

If you don't have sufficient swap space, forking a new process will result in ENOMEM (errno 12).

Whether or not your process ever uses the reservation is dependent upon memory pressure. If pages of a process are paged-out, the actual I/O that occurs is seen in the 'po' column of 'vmstat'. When values in this column begin to reach double-digits, your performance has degraded.

Regards!

...JRF...
Hakki Aydin Ucar
Honored Contributor

Re: virtual and swap

Swapinfo and vmstat ; They are totaly different commands as Dennis said:

Check this out about detailed vmstat:

http://forums13.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1251834846043+28353475&threadId=1347885
Kranti Mahmud
Honored Contributor

Re: virtual and swap

Hi himacs,

swapinfo ├в system paging space information. swapinfo prints information about device and file system paging space. (Note: the term `swap' refers to an obsolete implementation of virtual memory; HP-UX actually implements virtual memory by way of paging rather than swapping. This command and others retain names derived from `swap' for historical reasons.) For more details check it:

http://docs.hp.com/en/B2355-60105/swapinfo.1M.html

vmstat-vmstat ├в report virtual memory statistics. The vmstat command reports certain statistics kept about process, virtual memory, trap, and CPU activity. It also can clear the accumulators in the kernel sum structure. For more details check it:
http://docs.hp.com/en/B2355-60127/vmstat.1.html

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