Operating System - HP-UX
1834604 Members
3601 Online
110069 Solutions
New Discussion

Re: Do I have a memory leakage ??

 
SOLVED
Go to solution
Martin Simonis
Advisor

Do I have a memory leakage ??

Running HP-UX 11.0 on HP 9000 'N' class. 2x550 mHz processors. 1Gb memory.

We have an app that performs very badly, though it runs 4 times quicker on supplier's (smaller) box. Database seems tuned OK.

/sbin/dmesg shows memory information:
physical 1048576 Kb, lockable 701920 Kb, available 816496 Kb.

Running 'top' shows 157 Mb real, 110Mb virtual, 235 Mb free (see attached).

Question is, where is the remainder of the 1 Gb memory ? Should real+free=1Gb ? Suggestion is that it has not been initialised properly at reboot, or possible bad memory chip in box, or is 'leaking' away.

I have re-booted the server and free memory showed high (800+ Mb), but it has gone down to 300 Mb over the course of the day.

I would be very grateful if someone could propose a way forward.

10 REPLIES 10
Sridhar Bhaskarla
Honored Contributor

Re: Do I have a memory leakage ??

Hi Martin,

You will get a good picture of memory utilization if you have glance. It has a seperate memory detailed section.

Now, the difference between the total physical memory and the real+free is given to system memory and the buffer cache used.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sridhar Bhaskarla
Honored Contributor

Re: Do I have a memory leakage ??

..... and the buffer cache will occupy significant amount of memory if the default max_dbc_pct is not changed. It is not showed as free mem in the top window if I am correct.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
S.K. Chan
Honored Contributor

Re: Do I have a memory leakage ??

Attached is a write up on the process of how to detect a memory leak and how to identify if it's a kernel or process that is leaking memory. Hope it helps.
nancy rippey
Trusted Contributor

Re: Do I have a memory leakage ??

Martin,
In the past I have been successful at locating memory leaks by using the following command
UNIX95= ps -e -o ruser,vsz,pid,args | sore -rnk2 | more

This will list the memory for processess in desencing order. Run this command a few times. If the number in the second column (amount of memory) continues to rise then you probably have a memory leak.
Hope this helps!
nrip
Krishna Prasad
Trusted Contributor

Re: Do I have a memory leakage ??

Does your application use a shared memory segment.

When you type in ipcs -mb what to you see.

Other tips mentioned will help. Glance is good tool. Also check buffer cache setting.

Also, Since you have a N running HP-UX 11.0 64 bit why not take advantage of getting to a bigger memory regions?
Positive Results requires Positive Thinking
T. M. Louah
Esteemed Contributor

Re: Do I have a memory leakage ??

*** Quoting ITRC doc id A3940339 ***
TOP shows the following values for memory:
Memory: 1stval (2ndval) real, 3rdval (4thval) virtual, (5thval) free

these values can be understood as:

1. Total physical memory in the system dedicated to text, data or
stack segments for all processes on the system.

2. Total physical memory for runnable processes, as opposed to
sleeping processes.

3. Total memory dedicated to text, data or stack segments for all processes
on the system. Some of this is paged out to disk (that is, not all
of this is in current physical memory.

4. Total memory for runnable processes, as opposed to sleeping or stopped
processes.

5. Physical memory the system considers to be unused and available to new
processes. When this value is low, swapping is likely to occur.

g'd luck
t++
Little learning is dangerous!
Martin Simonis
Advisor

Re: Do I have a memory leakage ??

Many thanks to those who responded so quickly and pertinently (points awarded, shortly !).

Attached document is screen dump a) of the Memory report produced by 'glance', and b) of the output from 'ipcs -mb'.

Should I be concerned at the high figure against 'Page Faults' ? What does the ipcs output tell me about shared memory ? Is the high memory utilisation reasonable ? Where do I find the GBL_MEM_UTIL ?

In short, I am still unsure whether there is a memory problem or not.
Steve Steel
Honored Contributor

Re: Do I have a memory leakage ??

 
If you want truly to understand something, try to change it. (Kurt Lewin)
Marc Dijkstra
Trusted Contributor

Re: Do I have a memory leakage ??

Hi Martin

From your glance, I would be worried about the page-outs, rather than the page faults.

Check your swap utilization with:
swapinfo -t

And to check if you have a memory hogger in the process list:

UNIX95= ps -e -o ruser,vsz,pid,args |sort -rnk2| head -n 10

to get the top 10 memory users.

MND
"A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila"
Sridhar Bhaskarla
Honored Contributor
Solution

Re: Do I have a memory leakage ??

Hi Martin,

Looks like you have the default max_dbc_pct value which is 50%. You can reduce it to 20%. You can set it even to around 10% as you don't do much disk IO (from your glance itself).
Adjust your buffer cache and then see how the system performs. I don't think you have any memory leaks.

If adjusting buffer cache doesn't help, then probably you need to buy little bit more memory.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try