View Full Version : memory leak???
rvantwisk
23-01-2009, 15:46
http://java-monitor.com/postedimages/9f2a199f-c7fe-4869-8988-4c0847d78a8c.png
hey All,
de blue line and de green line keeps on going up and never goes down. Does that mean we have a memory leak in one of our applications? (On the graph non heap memory).
On my other graph attached I see the same blue line going up, and never goes down. (Heap memory graph)
If so, my next question would be how to figure out who is consuming this. Are there any tools available?
Ries
kjkoster
23-01-2009, 21:14
Dear rvantwisk,
Hmm. Based on just this graph I would not say so immediately. Sometimes there are some artifacts from the sample time that Java-monitor uses, like you can see in this graph from Robbio (http://java-monitor.com/forum/showthread.php?t=132).
If you have a memory leak, you will see that the mark sweep garbage collectors works a lot. Could you post your gc count and gc time graphs? They will tell us more about your memory usage.
Kees Jan
rvantwisk
23-01-2009, 22:08
Hey Kees,
you can call me Ries, attached the two selected graphs but also the same graph again at the moment that GF runs out of memory.
You can see the green line spikes and pretty much stays there.
Ries
kjkoster
24-01-2009, 12:46
Dear Ries,
I have to apologize. I misread the first graph in the post. I thought it was the heap memory graph and now I see it is the non-heap memory graph. Please ignore my first reply, it is wrong. The non-heap memory graph looks ok.
You look at img2.jpg in your last post, you can see that the blue line, indicating the MarkSweepCompact GC times have spikes of several seconds, sometimes as high as 15 seconds. During those spikes, you will probably experience temporary freezes of the JVM.
In the heap memory graph (img3.jpg) you see that these spikes seem to coincide with sudden peaks in memory use.
I would say, based on these graphs, that you have some code in your application that consumes large amounts of memory.
If you have a memory leak, it is a very slow one. One that takes more than two days to fill up the RAM. It's hard to see.
What you can do is try to make a memory dump (jmap -heap) when you see memory consumption rise sharply. Also take memory dumps just before you restart the system that has run out of memory.
Also take thread dumps (jstack) at the same time, so that you can see what servlet triggers the sudden peak in memory use.
You can analyse the memory dumps with jhat.
In the short term, giving the JVM a little more memory may help, but I doubt it will cure the problem. It might even make it worse by introducing even longer gc times. You'll have to experiment. :-/
Does this help?
Kees Jan
rvantwisk
24-01-2009, 13:27
hey Kees,
yes every bit of information does help. Some of our application do indeed need more memory because of a ReportingSolution we have in place (JasperReports). However, as you could see at some point it starts to spike, and never goes back down.
Next time it happens I will run the tools and see what I get.
Ries
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.