Tomcat 6.0的 This is very likely to create a memory leak.错误解决

问题现象:
关闭tomcat 6.0.44时报下面内存泄漏相关的警告:
严重: The web application [/xxx] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak.
2015-10-15 9:06:31 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
严重: The web application [/xxx] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@3278f]) and a value of type [com.alibaba.druid.wall.spi.WallVisitorUtils.WallTopStatementContext] (value [com.alibaba.druid.wall.spi.WallVisitorUtils$WallTopStatementContext@ae3614]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
2015-10-15 9:06:31 org.apache.coyote.http11.Http11AprProtocol destroy
信息: Stopping Coyote HTTP/1.1 on http-9090
2015-10-15 9:06:31 org.apache.coyote.ajp.AjpAprProtocol destroy
信息: Stopping Coyote AJP/1.3 on ajp-9009

导致通过shutdown.bat/sh 无法停止tomcat进程。

原因分析:6.0.24版本起新增了JreMemoryLeakPreventionListener导致的。

尝试屏蔽这个功能: 
<!-- Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" / -->

测试了下,没有效果。

又尝试关闭时增加强制命令参数:
call "%EXECUTABLE%" stop -force %CMD_LINE_ARGS%
测试了下,也没有效果。

升级到7.0.6以上的版本,问题可以解决。
不想升级的,可以用6.0.24以下的版本吧!!!

猜你喜欢

转载自dbaspider.iteye.com/blog/2249258
今日推荐