title: Memory Leaks in web application
body: <p>I've got a web application developed using Netbeans IDE. I added a Web Service from WSDL. The problem is that it becomes heavier and slower each time I deploy it. Sometimes it makes my IDE crash.</p>
  
  <p>I don't know how to solve this problem. I read other questions on stackoverflow, but they just suggest to expand the permSpace or something similar. I would rather try to understand what's going wrong, and why my space isn't cleared as it should.</p>
  
  <p>This is what I get in Tomcat's console:</p>
  
  <pre><code>INFO: WSSERVLET13: JAX-WS context listener destroyed
  13-nov-2013 16.24.02 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
  GRAVE: The web application [/SOAPolls] created a ThreadLocal with key of type [com.sun.xml.bind.v2.runtime.Coordinator$1] (value [com.sun.xml.bind.v2.runtime.Coordinator$1@53c6a7fc]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@173ebc5c]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
  13-nov-2013 16.24.02 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
  GRAVE: The web application [/SOAPolls] created a ThreadLocal with key of type [org.glassfish.gmbal.generic.OperationTracer$1] (value [org.glassfish.gmbal.generic.OperationTracer$1@17c047f0]) and a value of type [java.util.ArrayList] (value [[]]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
  13-nov-2013 16.24.02 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
  GRAVE: The web application [/SOAPolls] created a ThreadLocal with key of type [com.sun.xml.bind.v2.ClassFactory$1] (value [com.sun.xml.bind.v2.ClassFactory$1@50b2e9be]) and a value of type [java.util.WeakHashMap] (value [{class javax.xml.bind.annotation.W3CDomHandler=java.lang.ref.WeakReference@14a877c0, class com.sun.xml.ws.runtime.config.Tubelines=java.lang.ref.WeakReference@404de8d8, class java.util.ArrayList=java.lang.ref.WeakReference@3af1dde3, class com.sun.xml.ws.runtime.config.TubelineDefinition=java.lang.ref.WeakReference@5d1e8050, class com.sun.xml.ws.runtime.config.TubeFactoryList=java.lang.ref.WeakReference@7d7a33f2, class com.sun.xml.ws.runtime.config.MetroConfig=java.lang.ref.WeakReference@61e89539, class com.sun.xml.ws.runtime.config.TubeFactoryConfig=java.lang.ref.WeakReference@6c9d0366, class javax.xml.bind.annotation.adapters.CollapsedStringAdapter=java.lang.ref.WeakReference@384a553f}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
  13-nov-2013 16.24.02 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
  GRAVE: The web application [/SOAPolls] created a ThreadLocal with key of type [org.glassfish.gmbal.generic.OperationTracer$1] (value [org.glassfish.gmbal.generic.OperationTracer$1@17c047f0]) and a value of type [java.util.ArrayList] (value [[]]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
  13-nov-2013 16.24.03 org.apache.catalina.startup.HostConfig deleteRedeployResources
  </code></pre>
  
  <p>What can I do?</p>
  
  <p>Plus: is there a way to manually clear the space I need, in order to make my application run for a bit more (a temporary solution since I've got an exam in the next days)?</p>
  
  <p><strong>EDIT:</strong> I tried to restart the server. But sometimes the IDE will not be able to undeploy the application when I try to stop Tomcat (and everything gets stuck).</p>