tomcat7 - jdbc datasource - This is very likely to create a memory leak

后端 未结 3 1722
盖世英雄少女心
盖世英雄少女心 2020-11-27 14:51

I get the following messages in catalina.out log file when tomcat is shutdown. I am using Tomcat 7.x and the Tomcat JDBC data source.

Mar 26, 2013 1:17:52 PM         


        
相关标签:
3条回答
  • 2020-11-27 15:09

    It could be related to this bug in the MySQL jdbc connector: http://bugs.mysql.com/bug.php?id=65909.

    You can wait for the MySQL team to fix it, or you try to use the Drizzle JDBC connector which works fine with MySQL (you have just to change the parameter in the url connection) and, in my tests, doesn't have this kind of bug.

    0 讨论(0)
  • 2020-11-27 15:21

    I met the same problem just like you ,and I just roll back the pom version of mysql-connector-java from 8.0.16 to 8.0.15 and the problem got resolved,I think it's the unmatch between the version of connector and mysql that caused the problem

    0 讨论(0)
  • 2020-11-27 15:31

    Try to put the sql Connector/Driver in the tomcat/lib and not in the war. Because every time you deploy the war the connector/driver will be created sometimes the garbage collector cant remove them which will ends in a memory leak. So try to move the connector on the tomcat/lib folder.

    Please read the following answers:

    Why must the JDBC driver be put in TOMCAT_HOME/lib folder?

    How to configure Tomcat to connect with MySQL

    0 讨论(0)
提交回复
热议问题