我在Tomcat中遇到了由于孤立线程导致的内存泄漏问题。特别是,似乎Guice和JDBC驱动程序没有关闭线程。
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.
我知道这与其他问题相似(例如这个),但在我的情况下,“不要担心”这个答案是不够的,因为它给我带来了问题。我有一个CI服务器定期更新此应用程序,经过6-10次重新加载后,CI服务器将挂起,因为Tomcat已经用完了内存。
我需要能够清除这些孤立的线程,以便我可以更可靠地运行我的CI服务器。感谢任何帮助!