Operating System - HP-UX
1837835 Members
2393 Online
110121 Solutions
New Discussion

Real TIme Process Memory Usage

 
SOLVED
Go to solution
Kevin McNamara_1
Occasional Advisor

Real TIme Process Memory Usage

I need to monitor process memory usage in real time. What command can I use to display the amount of memory a proces is currently using?
8 REPLIES 8
Sundar_7
Honored Contributor

Re: Real TIme Process Memory Usage

Glance if you have it installed and license.

# glance (or gpm)
Learn What to do ,How to do and more importantly When to do ?
Marco A.
Esteemed Contributor

Re: Real TIme Process Memory Usage

the command "top" also has a good view of the memory usage and processes running.

#top

Marco
Just unplug and plug in again ....
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Real TIme Process Memory Usage

If you don't have Glance then all you need is ps with the XPG4 behavior asserted.

Determine the process PID of interest using ps in the normal fashion then:

UNIX95=1 ps -p PID -o comm,vsz,etime
If it ain't broke, I can fix that.
Jaime Bolanos Rojas.
Honored Contributor

Re: Real TIme Process Memory Usage

Kevin,

Also this thread talks about process memory
usage, please check it as it looks very helpful too:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=838754&admit=-682735245+1176998017125+28353475

Regards,

Jaime.
Work hard when the need comes out.
Kevin McNamara_1
Occasional Advisor

Re: Real TIme Process Memory Usage

Thanks for all the replies. I like the "UNIX95 ps" command. I can use this in a script. But, the VSZ that it reports does not match the RSS column (This consists of text, data, stack, as well as the process memory) in Glance. How can I get the "UNIX95 ps" command to report the RSS value from Glance?
A. Clay Stephenson
Acclaimed Contributor

Re: Real TIme Process Memory Usage

Asking ps to give you the same values as a sophisticated tool like Glance isn't all that realistic. It is very difficult to decide just what per-process memory usage means. How does shared memory count? How about shared text? In any event, since you have Glance, you can use the command-line interface (-adviser-only option) and get whatever metrics you are interested in. A search should turn up tons of examples.
If it ain't broke, I can fix that.
Don Morris_1
Honored Contributor

Re: Real TIme Process Memory Usage

Setting aside differences in precision between Glance vs. pstat [which is where ps gets the data], one big reason for a discrepancy here is that you want SZ from ps (physical memory size) if you're comparing RSS.. not VSZ (virtual memory size).
Kevin McNamara_1
Occasional Advisor

Re: Real TIme Process Memory Usage

Thanks again for the great info. I think using the advisor_only feature of Glance is going to do the trick.