Operating System - HP-UX
1836585 Members
2265 Online
110102 Solutions
New Discussion

interpreting "top" and "swapinfo" memory usage

 
David Black_5
Occasional Advisor

interpreting "top" and "swapinfo" memory usage

I am having problems understanding the figures from top and swapinfo, they don't seem to correlate, see below:
TOP
Load averages: 0.32, 0.50, 0.60
327 processes: 298 sleeping, 28 running, 1 zombie
Cpu states:
CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS
0 0.35 1.0% 0.0% 2.4% 96.6% 0.0% 0.0% 0.0% 0.0%
1 0.28 0.0% 63.6% 8.5% 27.8% 0.0% 0.0% 0.0% 0.0%
2 0.24 1.4% 0.2% 4.4% 94.0% 0.0% 0.0% 0.0% 0.0%
3 0.43 7.0% 25.8% 4.8% 62.4% 0.0% 0.0% 0.0% 0.0%
--- ---- ----- ----- ----- ----- ----- ----- ----- -----
avg 0.32 2.4% 22.5% 5.0% 70.2% 0.0% 0.0% 0.0% 0.0%

Memory: 1938708K (515936K) real, 2824156K (833892K) virtual, 150052K free

swapinfo
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4194304 330780 3863524 8% 0 - 1 /dev/vg00/lvol2
reserve - 1730372 -1730372
memory 3207192 1335372 1871820 42%
total 7401496 3396524 4004972 46% - 0

TOP is showing 1938708K real memory, when in fact I know there is 4GB on this box, swapinfo confirms this in the "memory" section. Also top
shows virtual memory as 2824156K but again I have defined a 4GB swap area (see swapinfo).
Am I misinterpreting the values or is pseudo swapping effecting the figures?

Thanks,
Dave Black
2 REPLIES 2
Steven E. Protter
Exalted Contributor

Re: interpreting "top" and "swapinfo" memory usage

swapinfo -tam is going to deliver you better, more usuable numbers.

You are swapping lightly from these figures.

You may want to use vmstat to collect data over time with averages, or the script I'm attaching , the virutal memory portion.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sundar_7
Honored Contributor

Re: interpreting "top" and "swapinfo" memory usage

DONOT go by swapinfo memory output. That is just information on the psuedo swap.

You will see that memory line in the swapinfo if you have the kernel parameter swapmem_on set to 1 and it is approximately 75% of your total physical memory. This is decided dynamically at boot time.

The top memory line shows only the real and virtual memory that is currently being used with the "active" virtual/real memory shown in the parenthesis.
Learn What to do ,How to do and more importantly When to do ?