Operating System - HP-UX
1834925 Members
2605 Online
110071 Solutions
New Discussion

Re: listing top memory using processes

 
William Pribble
Frequent Advisor

listing top memory using processes

How do I list my systems top memory using processes. Running HP-UX 11.0.

Thanks
6 REPLIES 6
Martin Johnson
Honored Contributor

Re: listing top memory using processes

If you have glance/gpm, you can sort the process list by Resident memory.

HTH
Marty
MANOJ SRIVASTAVA
Honored Contributor

Re: listing top memory using processes

Do a top -h , man top will the be the best palce to start , however if u can install glance , it will give you more stats .


Manoj Srivastava
James R. Ferguson
Acclaimed Contributor

Re: listing top memory using processes

Hi:

To list processes in decending order of virtual memory size, do:

# UNIX95= ps -e -o "user,vsz,pid,ppid,args" | awk 'NR>1' | sort -rnk2

Note the blank (space) character after the equal sign and before the 'ps' command. This means that UNIX95 behavior applies only to the command line.

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: listing top memory using processes

Type this as shown:

UNIX95= ps -e -o vsz,ruser,pid,args | sort -rn | more

The largest process will be sorted to the top of the list. NOTE: The size (VSZ) shown does not include shared memory, shared libraries, buffer cache, etc as these are shared.


Bill Hassell, sysadmin
Wodisch
Honored Contributor

Re: listing top memory using processes

Hi Elaine,

look into the *POSIX* options of "ps(1)", there are some to show what you look for (and then you would "sort" the output accordingly):

UNIX95=x ps -eo pid,flags,sz

"sz" is the amount of RAM used in "pages" (which are usually 4KB in size). For the real page-size check the output of "chatr" on the codefile of the process.

HTH,
Wodisch
S.K. Chan
Honored Contributor

Re: listing top memory using processes

Another way is using glance's adviser ..
# cd /opt/perf/examples/adviser
# cp proc_mem_leak my_proc
# vi my_proc
==> Change the VSSthreshold from 30MB to a lower number .. say 1MB.. so set it to 1000
# glance -adviser_only -syntax my_proc -iterations 1 > my_output
Take a look at "my_output" for the details. This is not sorted of course.