SEVERE: The web application [] registered the JDBC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Jun 30, 2018 8:57:08 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc
SEVERE: The web application [] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Jun 30, 2018 8:57:08 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [startQuartz_Worker-1] but has failed to stop it. This is very likely to create a memory leak.
Jun 30, 2018 8:57:08 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [startQuartz_Worker-2] but has failed to stop it. This is very likely to create a memory leak.
Jun 30, 2018 8:57:08 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [startQuartz_Worker-3] but has failed to stop it. This is very likely to create a memory leak.
Jun 30, 2018 8:57:08 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [startQuartz_Worker-4] but has failed to stop it. This is very likely to create a memory leak.
Jun 30, 2018 8:57:08 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [startQuartz_Worker-5] but has failed to stop it. This is very likely to create a memory leak.
Jun 30, 2018 8:57:08 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [startQuartz_Worker-6] but has failed to stop it. This is very likely to create a memory leak.
Jun 30, 2018 8:57:08 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [startQuartz_Worker-7] but has failed to stop it. This is very likely to create a memory leak.
Jun 30, 2018 8:57:08 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [startQuartz_Worker-8] but has failed to stop it. This is very likely to create a memory leak.
Jun 30, 2018 8:57:08 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [startQuartz_Worker-9] but has failed to stop it. This is very likely to create a memory leak.
Jun 30, 2018 8:57:08 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [startQuartz_Worker-10] but has failed to stop it. This is very likely to create a memory leak.
Jun 30, 2018 8:57:08 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The 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.
以上是tomcat报出的错误信息。
原因分析:通过查询大量资料,同时结合自己的项目情况,分析得出引起tomcat memory leak 的原因有:
1、jdbc Driver在tomcat运行时进行注册,但是当tomcat停止时没有解除注册;
2、使用quartz跑定时任务时,tomcat停了,quartz的线程没有停掉;
3、web 容器重启一个叫Abandoned connection cleanup thread的线程失败.
解决办法:
1、用脚本语言代替quartz的定时任务或将quartz与业务代码剥离开来;