开发者社区> 问答> 正文

tomcat7-jdbc数据源-这很可能造成内存泄漏?mysql

当tomcat关闭时,我在catalina.out日志文件中收到以下消息。我正在使用Tomcat 7.x和Tomcat JDBC数据源。

Mar 26, 2013 1:17:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc SEVERE: The web application [/my_webapp] 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. Mar 26, 2013 1:17:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/my_webapp] 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. 第一个声称DataSource已被强制取消注册,这样很好。但是,这很奇怪,因为我已经像这样配置了destroy-method:


不知道为什么我得到第二个。关于“ MySQL语句取消计时器”的内容。

任何帮助表示赞赏

编辑1:我尝试了@Zelldon建议的修复程序,它摆脱了第一个错误。但是MySQL Statement Cancellation Timer相关问题仍然存在

展开
收起
保持可爱mmm 2020-05-17 19:10:39 575 0
1 条回答
写回答
取消 提交回答
  • 尝试将sql Connector / Driver放在tomcat / lib中,而不是放在战争中。因为每次部署战争时都会创建连接器/驱动程序,所以有时垃圾收集器无法删除它们,而这将导致内存泄漏。因此,请尝试将连接器移至tomcat / lib文件夹中。来源:stack overflow

    2020-05-18 11:14:37
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
阿里云MySQL云数据库产品体系介绍 立即下载
One Box: 解读事务与分析一体化数据库 HybridDB for MySQL 立即下载
One Box:解读事务与分析一体化数据库HybridDB for MySQL 立即下载

相关镜像