Re: Memory Leak warning in Tomcat when using com.mysql.cj.jdbc(mysql-connector-java Version 8.0.11)
Posted by: Filipe Silva
Date: May 16, 2018 12:17PM

You shouldn't de-register JDBC drivers by yourself, Tomcat has mechanisms to do proper thread sanitizing for threads spawn within contexts.

Under some circumstances you'll get this warning but that doesn't mean that there's actually a memory leak going on. I would suggest you to monitor the running JVM instance to see what's happening to this particular thread.

What you need to know is that if Connector/J is in Tomcat's global libraries directory only, then you should only see one instance of this thread and, once created, it should live until the JVM is stopped. If you put the Connector/J jar inside the local application libraries directories, then you'll see one 'Abandoned connection cleanup thread' per application that actually uses the connector, and if you stop the application, then the corresponding thread should die (mind that it may take up to 5 secs to happen)

There are a few ways of dealing with 'Abandoned connection cleanup thread' termination. Some of which actually avoid the warning message. Consult the Connector/J 5.1.41 release notes (https://dev.mysql.com/doc/relnotes/connector-j/5.1/en/news-5-1-41.html) or the Bug#69526 and related reports (https://bugs.mysql.com/bug.php?id=69526) to get more information about this issue.

Options: ReplyQuote


Subject
Written By
Posted
Re: Memory Leak warning in Tomcat when using com.mysql.cj.jdbc(mysql-connector-java Version 8.0.11)
May 16, 2018 12:17PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.