用C3P0做数据库连接池,在Tomcat运行项目中运行项目,出现了貌似内存泄露的问题,很困扰,请大神指点
2014-9-2820:21:35org.apache.catalina.loader.WebappClassLoaderclearReferencesJdbc严重:Th...
2014-9-28 20:21:35 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/JavaWebAuthority] 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.
2014-9-28 20:21:35 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/JavaWebAuthority] appears to have started a thread named [Timer-1] but has failed to stop it. This is very likely to create a memory leak.
2014-9-28 20:21:35 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/JavaWebAuthority] appears to have started a thread named [C3P0PooledConnectionPoolManager-Helper Thread-#0] but has failed to stop it. This is very likely to create a memory leak.
2014-9-28 20:21:35 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/JavaWebAuthority] appears to have started a thread named [C3P0PooledConnectionPoolManager-Helper Thread-#1] but has failed to stop it. This is very likely to create a memory leak.
2014-9-28 20:21:35 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/JavaWebAuthority] appears to have started a thread named [C3P0PooledConnectionPoolManager-Helper Thread-#2] but has failed to stop it. This is very likely to create a memory leak.
2014-9-28 20:21:35 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/JavaWebAuthority] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
当我第一次发布时没有问题,在浏览器里面点几下,然后再次发布就会出现上面的严重消息,我的财富值不够了,希望能帮我解决啊, 展开
严重: The web application [/JavaWebAuthority] 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.
2014-9-28 20:21:35 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/JavaWebAuthority] appears to have started a thread named [Timer-1] but has failed to stop it. This is very likely to create a memory leak.
2014-9-28 20:21:35 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/JavaWebAuthority] appears to have started a thread named [C3P0PooledConnectionPoolManager-Helper Thread-#0] but has failed to stop it. This is very likely to create a memory leak.
2014-9-28 20:21:35 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/JavaWebAuthority] appears to have started a thread named [C3P0PooledConnectionPoolManager-Helper Thread-#1] but has failed to stop it. This is very likely to create a memory leak.
2014-9-28 20:21:35 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/JavaWebAuthority] appears to have started a thread named [C3P0PooledConnectionPoolManager-Helper Thread-#2] but has failed to stop it. This is very likely to create a memory leak.
2014-9-28 20:21:35 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/JavaWebAuthority] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
当我第一次发布时没有问题,在浏览器里面点几下,然后再次发布就会出现上面的严重消息,我的财富值不够了,希望能帮我解决啊, 展开
1个回答
2014-09-29
展开全部
我觉得是jdbc无法关闭,所以tomcat强制关闭导致的,据说这是basicdatasource的bug可以重写一下close方法
public class XBasicDataSource extends BasicDataSource {
@Override
public synchronized void close() throws SQLException {
DriverManager.deregisterDriver(DriverManager.getDriver(url));
super.close();
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询