Re: Does ever growing SZ from ps indicate memory leak?
- From: apm35@xxxxxxxxxxxxxxxxxx
- Date: Thu, 17 Jan 2008 02:56:49 -0800 (PST)
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
.
- Follow-Ups:
- Re: Does ever growing SZ from ps indicate memory leak?
- From: Scott Lurndal
- Re: Does ever growing SZ from ps indicate memory leak?
- From: Syren Baran
- Re: Does ever growing SZ from ps indicate memory leak?
- References:
- Does ever growing SZ from ps indicate memory leak?
- From: apm35
- Re: Does ever growing SZ from ps indicate memory leak?
- From: Paul Pluzhnikov
- Does ever growing SZ from ps indicate memory leak?
- Prev by Date: Re: socket programming again: possible to *sniff* udp packets before buffer is emptied?
- Next by Date: Re: Does ever growing SZ from ps indicate memory leak?
- Previous by thread: Re: Does ever growing SZ from ps indicate memory leak?
- Next by thread: Re: Does ever growing SZ from ps indicate memory leak?
- Index(es):
Relevant Pages
|