Every time I start and stop tomcat service I get following info in tomcat-stderr.log file:
SEVERE: The web application [/twinkle] registered the JDBC driver [net.sourceforge.jtds.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 01, 2016 2:02:00 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/twinkle] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
Mar 01, 2016 2:02:00 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/twinkle] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0] but has failed to stop it. This is very likely to create a memory leak.
Mar 01, 2016 2:02:00 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/twinkle] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1] but has failed to stop it. This is very likely to create a memory leak.
Mar 01, 2016 2:02:00 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/twinkle] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2] but has failed to stop it. This is very likely to create a memory leak.
Mar 01, 2016 2:02:00 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/twinkle] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#3] but has failed to stop it. This is very likely to create a memory leak.
Mar 01, 2016 2:02:00 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/twinkle] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#4] but has failed to stop it. This is very likely to create a memory leak.
Mar 01, 2016 2:02:00 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/twinkle] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#5] but has failed to stop it. This is very likely to create a memory leak.
Mar 01, 2016 2:02:01 AM org.apache.catalina.startup.HostConfig undeploy
INFO: Undeploying context [/twinkle]
Our application is crashing on production all the time and I was thinking that this could be one of few reasons if not the primary cause of it.
In our application I noticed many places where we create new Thread object;
FTPClient.java
217 Thread.sleep(5);
443 try { Thread.sleep(5); }
catch( InterruptedException ie) {}
557 Thread.sleep(5);
576 Thread.sleep(1);
ConnectionPool.java
private Thread m_CleanupThread = null;
protected ConnectionPool(String urlString, String user, String passwd)
{
...
m_CleanupThread = new Thread(this);
m_CleanupThread.start();
}
And many many more calls to Thread like this.
Should I use thread.setContextClassLoader(null);