title: Java Memory "Leak" with ConcurrentLinkedQueue$Node
body: <p>I am having an interesting dilemma where I appear to have a memory leak (or growing data structure). I get the typical "raising linearly over time" graph when I analyse my memory usage. Trying to figure out what the cause of the problem is, I did a heap-dump. What I found was that over 50% of memory was being allocated for a <code>ConcurrentLinkedQueue node</code>. The top consumers of memory are, <code>com.singularity.ee.agent.util.ch</code> and <code>java.util.concurrent.ConcurrentLinkedQueue$Node</code> as seen in the picture below. </p>
  
  <p><img src="https://i.stack.imgur.com/PD1gS.png" alt="enter image description here"></p>
  
  <p>I dont know what a <code>util.ch</code> is but it appears to be tied to the Node, as each ch has an immediate reference to a node, so no worries focusing on that.</p>
  
  <p>Now trying to find references to the closest GC for a $Node, I get the following:</p>
  
  <p><img src="https://i.stack.imgur.com/QyAXt.png" alt="enter image description here"></p>
  
  <p>Whats strange about this is that it does not have a ConcurrentLinkedQueue$Node, or even a ConcurrentLinkedQueue as a parent at all. All references are strange types that I do not understand, <code>kh, uc, z, g, etc.</code> Does anyone know what these types are?</p>
  
  <p>I am trying to find out what exactly is causing the problem, but I cant seam to find how these nodes are even being created/saved. </p>
  
  <p>Here is the kicker: I do not use the ConcurrentLinkedQueue anywhere in my code. I do use a ConcurrentHashMap, but there are not very many HashMap$Node's so that shouldnt be the issue. </p>
  
  <p>Does anyone have any ideas as to how these nodes are being created or why I have so many instances of them?</p>
  
  <p>To answer dependency questions: I am running tomcat 6, java 6, Java Spring.</p>