Operating System - HP-UX
1833065 Members
2663 Online
110049 Solutions
New Discussion

the memory allocate size in top and ps -eo is different

 
SOLVED
Go to solution
洪國軒
Occasional Contributor

the memory allocate size in top and ps -eo is different

below is top output
it show hpvmapp process allocate about 1G memory
TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND
? 8662 root 152 20 1066M 1050M run 14:05 0.92 0.92 hpvmapp
? 3630 root 152 20 1066M 1052M run 28:23 0.85 0.84 hpvmapp

but in ps -eo command output
only use 415 and 736 page
I don't know why,and which output is corrent??

# ps -eo ruser,pcpu,sz,sz,vsz,pid,args |grep hpvmapp
root 0.00 25 25 104 11940 grep hpvmapp
root 0.93 415 415 4308 8662 hpvmapp -d compass1
root 0.89 736 736 4308 3630 hpvmapp -d compass2

3 REPLIES 3
Peter Godron
Honored Contributor
Solution

Re: the memory allocate size in top and ps -eo is different

Steven E. Protter
Exalted Contributor

Re: the memory allocate size in top and ps -eo is different

Shalom,

The two utilities use different calculation methods. A small disagreement is completely normal.

swapinfo -tam is the best way to go here.

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
Bill Hassell
Honored Contributor

Re: the memory allocate size in top and ps -eo is different

top's memory numbers are almost meaningless. ps is somewhat more accurate but is incomplete. There is no simple metric reporting the amount of RAM used by a program. A program has 4 quadrants, data and text being the most important. But the text area (unchanging instructions) is shared which means that hpvmapp is 2 processes but one shared text area. Additionally, programs will use shared libraries in the OS area. The data, stack and I/O areas are unique but a set of programs may also use shared memory to communicate. And the programs may use memory-mapped files.

Couple that with the OS mapping the needed pages as needed and you have a very complex indication of actual RAM used. That's why classic Unix tools like top and ps are not of much use for detailed analysis. You need a program designed specifically for HP-UX memory (and CPU and I/O) usage: GlancePlus.


Bill Hassell, sysadmin