I have an interesting dilemma where I seem to have a memory leak (or a growing data structure). When analyzing memory usage, I get a typical graph of "increasing linearity in time." Trying to figure out what was causing the problem, I made a bunch of dumps. I found that more than 50% of the memory is allocated for the ConcurrentLinkedQueue node . The main consumers of memory are com.singularity.ee.agent.util.ch and java.util.concurrent.ConcurrentLinkedQueue$Node , as shown in the figure below.

I do not know what util.ch , but it looks like it is tied to Node, since each ch has a direct link to Node, so do not worry about it.
Now, trying to find links to the nearest GC for $ Node, I get the following:

What is strange is that it does not have ConcurrentLinkedQueue $ Node or even ConcurrentLinkedQueue as a parent at all. All links are weird types that I don't understand, kh, uc, z, g, etc. Does anyone know what these types are?
I am trying to figure out what exactly is causing the problem, but I cannot find how these nodes are created / saved.
Here is the kicker: I am not using ConcurrentLinkedQueue anywhere in my code. I use ConcurrentHashMap, but not much HashMap $ Node, so this should not be a problem.
Does anyone have any ideas on how these nodes are created or why I have so many of them?
Answer dependency questions: I am running tomcat 6, java 6, Java Spring.
java memory-leaks heap-dump
Nick humrich
source share