Operating System - HP-UX
1834645 Members
2514 Online
110069 Solutions
New Discussion

Re: memory reports in top and ps!!!

 
SOLVED
Go to solution
Eric Guerizec
Frequent Advisor

memory reports in top and ps!!!

Hi!
I try to understand how memory is used on my HP-UX 11 server.

Here is an example for a java process:
with ps (UNIX95) I have :
sz=554*4K=2216K
vsz=10300K
with top I have :
SIZE=10300K
RES=21296K

So vsz (in ps) = SIZE (in top)
It's the size of the process. Right?
But what does sz exactly report?
RES is the resident size of the process but what does it mean?
I use ipcs and my process java doesn't use shared memory. So why RES is so big?
Thanks for help!
3 REPLIES 3
Bill Hassell
Honored Contributor
Solution

Re: memory reports in top and ps!!!

top and ps are measuring very different parts of memory, and just be forewarned, understanding how memory is used in HP-UX (or any virtual memory Unix system) is very complex.

Program memory that is easy to identify are the 3 chunks: text (unchanging instructions), stack and data. That's the easy part. Virtually all programs will use shared libraries...now it gets complicated: how do you count memory allocated to shared libraries that many different programs use at the same time? (ans: there is no right answer)

Then there is the buffer cache, shared by all programs that read/write files. Very dynamic and many segments in the buffer cache are used by several programs at the same time (ie, a copy of the passwd file is usually in the cache all the time and accessed by every ls -l command).

Then there are memory-mapped files, semaphores and a myriad of other Inter-Process Communication calls, all of which should be equally shared by participants but impossible to fairly allocate.

So for today's systems, worrying about exactly how much RAM is used is not useful. Instead, look at the basics: text+stack+data (the vsz value in ps) to see if it grows without bounds, and put reasonable limits on the growth of the buffer cache (50% max is NOT reasonable). Then check vmstat for po (page outs) and when this number begins to appear as 2 or 3 digits (steadily), time for more RAM.

With the high cost of commercial quality database systems today, it makes no sense to cripple them with a few hundred megs of RAM.


Bill Hassell, sysadmin
harry d brown jr
Honored Contributor

Re: memory reports in top and ps!!!

Here's a good bedtime story:

http://docs.hp.com/hpux/onlinedocs/os/11i/mem_mgt.html


live free or die
harry
Live Free or Die
harry d brown jr
Honored Contributor

Re: memory reports in top and ps!!!