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

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


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


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.


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