开发者社区> 问答> 正文

在tomcat下项目冲突造成memory leak,怎么解决

先说说情况.

两个项目 A和B,单独放在同一环境不同tomcat启动都没问题.放在一个tomcat的webapps下面就会出错,只能正常启动其中的一个,另一个就起不来.

其中A项目出错的日志:

2013-6-29 0:27:58 org.apache.catalina.core.StandardContext startInternal
严重: Error listenerStart
2013-6-29 0:27:58 org.apache.catalina.core.StandardContext startInternal
严重: Context [/A] startup failed due to previous errors
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/A] 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.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [Timer-1] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-1] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-2] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-3] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-4] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-5] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-6] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-7] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-8] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-9] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-10] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [Timer-2] but has failed to stop it. This is very likely to create a memory leak.

刚开始以为是

严重: The web application [/A] 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.

这个原因造成的问题,但后来[com.mysql.jdbc.Driver] 这个问题解决了,后面的日志依然存在.

从日志来看,好像是quartz出了问题.我看了一下,A和B项目都有用到quartz,我试过统一quartz的jar包或版本,放在tomcat的lib下面,问题仍然存在.

tomcat版本是7,内存分配足够.

求助,如有遇到相同问题而且搞定的经验,希望告知,感谢大家!

展开
收起
小旋风柴进 2016-02-29 16:22:27 13143 0
1 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
Apache Tomcat 的云原生演进 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载