在tomcat(版本6.0.33)的 catalina.out中发现大量memory leak的日志 java
org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap web
SEVERE: The web application [] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@2618d45f]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@51dce88]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak. apache
这个是因为tomcat6.0.24之后的版本有加一个监控memory leak的listener 在tomcathome/conf/server.xml tomcat
<!-- Prevent memory leaks due to use of particular java/javax APIs--> app
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> spa
可是这个监控有bug才致使的误报 日志
解决方式任选一种 1 把tomcat降级为6.0.24如下的版本 server
2 将tomcat升级为7.0.6以上的版本 xml
3 在server.xml中去掉JreMemoryLeakPreventionListener的listener rem