title: Tomcat Guice/JDBC Memory Leak
body: <p>I'm experiencing a memory leak due to orphaned threads in Tomcat. Particularly, it seems that Guice and the JDBC driver are not closing threads.</p>
  
  <pre><code>Aug 8, 2012 4:09:19 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: A web application appears to have started a thread named [com.google.inject.internal.util.$Finalizer] but has failed to stop it. This is very likely to create a memory leak.
  Aug 8, 2012 4:09:19 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: A web application appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
  </code></pre>
  
  <p>I know this is similar to other questions (such as <a href="https://stackoverflow.com/questions/6025089/guice-tomcat-potential-memory-leak">this one</a>), but in my case, the answer of "don't worry about it" won't be sufficient, as it is causing problems for me. I have CI server which regularly updates this application, and after 6-10 reloads, the CI server will hang because Tomcat is out of memory.</p>
  
  <p>I need to be able to clear up these orphaned threads so I can run my CI server more reliably. Any help would be appreciated!</p>