Operating System - HP-UX
1825775 Members
2127 Online
109687 Solutions
New Discussion

Re: HOWTO: Determine memory usage by process

 

HOWTO: Determine memory usage by process

Our system admin is reporting 100% sustained memory utilzation on the box (hp-ux 11.11b). I, as the Oracle guy, am getting the finger pointed at since we recently did an upgrade to 9.2.0.6 & added an additional instance. However, I have SGA_MAX_SIZE defined & have checked PGA usage. I am only seeing something like 3.5GB being used (out of 8GB physically in the box) by all Oracle instances on this box. So, I am frustrated in that I believe that something other than the Oracle instances themselves are consuming the remaining memory. I realize it could be some other Oracle component: listener, private memory, agent, etc. So, my question is: Is there a tool that can analyze & report memory usage by process? With this, we can move from finger pointing to focusing on what needs to be fixed.

Thanks for any input on this.

Mark
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: HOWTO: Determine memory usage by process

Shalom Mark,

set UNIX95=1

You can do it with the ps command.

For more precision and easier reports, consider glance.

lsof may help you identify the process.

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
James R. Ferguson
Acclaimed Contributor

Re: HOWTO: Determine memory usage by process

Hi Mark:

I'd use 'glance' or this to sort the processes' memory use in descending amounts:

# UNIX95= ps -e -o vsz -o pid -o args |sort -k1nr|more

Regards!

...JRF...
Kent Ostby
Honored Contributor

Re: HOWTO: Determine memory usage by process

If you have an HP support contract they may be able to assist by providing kmeminfo to you. It's generally only used against crash dumps, but can be run against a live system without any harm (i.e. it's a read only program).
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
A. Clay Stephenson
Acclaimed Contributor

Re: HOWTO: Determine memory usage by process

UNIX95= ps -e -o comm,vsz

The rub is that it's very difficult to add up memory usage because shared library code, multiple instances of the same program, shared memory, and memory-mapped files might be counted multiple times.

For example, each instance of the vi editor gets a private data and stack segment but share a common text segment and shared library code. In that sense, the memory usage appears to be greater than it actually is.

The most meaningful metric to use is vmstat. If the pageout rate (po) is greater than 10 or so for more than a few tens of seconds then you are swapping. The performance impact of swapping is so great that reducing the size of the buffer cache or SGA is much better than allowing the box to swap. The additional disk fetches resulting from smaller caches is trivial (by a factor of ~100) when compared to that of swapping.
If it ain't broke, I can fix that.

Re: HOWTO: Determine memory usage by process

Jim,

I ran your suggested command & found it to be quite informative, enough to conclude that a large number of user connections, generated from the application, to one of the Oracle instances is responsible for the excessive memory consumption. Finger pointing has concluded & we are now focused on solving the problem.

I appreciate your timely reply & feedback from others.

Mark

Re: HOWTO: Determine memory usage by process

See Jim's reply!