Re: Does ever growing SZ from ps indicate memory leak?



On 16 Jan, 22:49, Paul Pluzhnikov <ppluzhnikov-...@xxxxxxxxx> wrote:

I used to think
that SZ was the amount of heap storage used, as allocated typically
(but not exclusively) through malloc.

Your thinking was obviously incorrect: there are many other ways
to obtain storage from the system, and most of them affect SZ.

Hmm, this is what I wondered so I came here for more information. Can
you tell me more please?

I originally assumed that no matter how many malloc and frees were done,
if they all matched and the app did not leak then SZ would not show an
ongoing upward trend.

Correct, assuming the application doesn't anything other than
malloc/free.

I don't understand. The app does plently more. Do you mean the app
might do other allocations such as using sbrk? Please explain.

The overall effect is a definate upward trend with an average
growth of 1 MB per hour.

So your application either has a leak, or contains a data structure
which keeps growing (which is different from a leak, but may be a
problem nonetheless).

Well, this is what I came here to check.


But the climb of SZ is relentless. It is one of the
biggest processes on the machine now and this has me worried.

So, what is your question?

My question is "does a slow but relentless climb of SZ indicate a
memory leak?". Sounds like the answer is "yes".

If you observe a 1MB/h growth over extended period of time

I do.

and if
such rate of growh is unacceptable to you

It is.

(e.g. because you expect
the server to stay up for 1 year, and the system doesn't have extra
8GB of RAM), then contact developers and ask them to do something
about it.

Er, I *am* the developer <ahem>. I am new to java but have been using C
++ for years. In C++ I can use purify to track down memory leaks but
not in java-land. I have been using JMX jconsole but this seems to
indicate there are no leaks. The graph of heap memory is a saw-tooth
as the GC kicks in every now and then. I thought I would use SZ from
ps as well as JMX since this java app is also calling a third-party C
API via SWIG-JNI.

Regards,

Andrew Marlow
.



Relevant Pages

  • Re: evc4 app memory leak
    ... You've got a leak. ... If you never malloc or LocalAlloc (or use a heap ... checked these and they all appear to have new/delete pairs. ... The app does have a section that deals with socket communication that uses ...
    (microsoft.public.pocketpc.developer)
  • Re: Fast address validity check
    ... If you just want to find a memory leak, writing full-blown malloc ... allocations and deallocatins into a large static ...
    (comp.unix.programmer)
  • Re: malloc questions in C
    ... malloc() or one of the similar functions, it will be available until you call free. ... A lot of C implementations will also free this memory for you when your program exits, ... /* a) myhappyfunmodule has an internal memory leak */ ...
    (comp.lang.c)
  • Re: What does SZ on the ps output mean?
    ... originally assumed that no matter how many malloc and frees were done, ... there shouldn't be an upward trend. ... hope of spotting any memory leak. ... examine the java heap as mgd by the JVM. ...
    (comp.unix.solaris)
  • Re: Cant create auto redraw error
    ... that's what I meant by many command button. ... My app is menu driven restaurant/Kiosk app. ... "We have a VB6 app that causes a gdi object leak in windows explorer, ... the explorer.exe would leak gdi objects. ...
    (microsoft.public.vb.general.discussion)