title: I need help finding my memory leak using MAT
body: <p>I'm using the MAT to compare two heap dumps. I've been taking a heap dump each day and it's growing by about 200 megs each day. I think the leak is associated with java.util.zip because of what the table shows and also because we added a new process recently that zips and unzips a lot of files. (see image)</p>
  
  <p><img src="https://i.stack.imgur.com/AuQmd.jpg" alt="Heap dump histogram compare"></p>
  
  <p>At this point I open the dominator and filtered for .<em>Inflater</em>. That produced a large list of java.util.zip.Inflater. Now I want to see what's holding these open so I picked one and ran the Path to GC root excluding weak and soft references (see image). </p>
  
  <p><img src="https://i.stack.imgur.com/mG84d.jpg" alt="GC Root"></p>
  
  <p>It looks like this has to do with the jar inflation and nothing to do with my process. At this point I'm stuck and need some suggestions.</p>
  
  <p>EDIT 1</p>
  
  <p>Sean asked about the ThreadLocals. If you look at the dominator_tree with no filter you see that java.lang.ApplicationShutdownHooks is 58% of the heap. If I expand some of those entries you can see that they seem to be in the ThreadLocalMap. How would I find what put them there?</p>
  
  <p><img src="https://i.stack.imgur.com/xH94X.jpg" alt="enter image description here"></p>
  
  <p>EDIT 2</p>
  
  <p>Sean's comment put me on the correct track. I'm using Glassfish v 2.0 and it has a <a href="http://java.net/jira/browse/GLASSFISH-14199" rel="nofollow noreferrer">memory leak</a>. It continually creates new LogManagers and adds them to the ApplicationShutdownHooks collection.</p>
  
  <p>I worked around the issue by cracking open the ApplicationShutdownHooks and manually removing the objects from the collection.</p>