解决memory leak问题
来源:互联网 发布:梦幻群侠传三优化版 编辑:程序博客网 时间:2024/05/20 04:08
异常如下:
严重: The web application [/codeMarket] registered the JBDC driver[com.mysql.jdbc.Driver] but failed to unregister it when the webapplication was stopped. To prevent a memory leak, the JDBC Driverhas been forcibly unregistered.
2012-2-9 17:43:12 org.apache.catalina.loader.WebappClassLoaderclearReferencesJdbc
严重: The web application [/codeMarket] registered the JBDC driver[oracle.jdbc.OracleDriver] but failed to unregister it when the webapplication was stopped. To prevent a memory leak, the JDBC Driverhas been forcibly unregistered.
2012-2-9 17:43:12 org.apache.catalina.loader.WebappClassLoaderclearReferencesThreads
严重: The web application [/codeMarket] appears to have started athread named [Timer-0] but has failed to stop it. This is verylikely to create a memory leak.
2012-2-9 17:43:12 org.apache.catalina.loader.WebappClassLoaderclearThreadLocalMap
严重: The web application [/codeMarket] created a ThreadLocal withkey of type [null] (value[com.opensymphony.xwork2.inject.ContainerImpl$10@e1666]) and avalue of type [java.lang.Object[]] (value[[Ljava.lang.Object;@e0ada6]) but failed to remove it when the webapplication was stopped. This is very likely to create a memoryleak.
2012-2-9 17:43:12 org.apache.catalina.loader.WebappClassLoaderclearThreadLocalMap
严重: The web application [/codeMarket] created a ThreadLocal withkey of type [null] (value[com.opensymphony.xwork2.inject.ContainerImpl$10@a8a314]) and avalue of type [java.lang.Object[]] (value[[Ljava.lang.Object;@16ab2e8]) but failed to remove it when the webapplication was stopped. This is very likely to create a memoryleak.
AbandonedObjectPool is used (org.apache.commons.dbcp.AbandonedObjectPool@11f1f12)
搜了一堆资料终于搞懂了
第一个问题:
严重: The web application [/codeMarket] registered the JBDC driver[oracle.jdbc.OracleDriver] but failed to unregister it when the webapplication was stopped. To prevent a memory leak, the JDBC Driverhas been forcibly unregistered.
------------------------------------------------------------------------------------------------------------------------------------------------------
网上资料:
详细如下:
应用程序注册了JDBC驱动,但当程序停止时无法注销这个驱动,tomcat为了防止内存溢出,就给强制注销了
https://issues.apache.org/jira/browse/DBCP-332
-------------------------------------------------------------------------------------------------------------------
解决:
重写了org.apache.commons.dbcp.BasicDataSource
package org.company.util;
import java.sql.DriverManager;
import java.sql.SQLException;
import org.apache.commons.dbcp.BasicDataSource;
public class XBasicDataSource extends BasicDataSource{
//
}
。。。
在dbcp数据源中的配置:
问题解决~
-------------------------------------------------------------------------------------------------------------
再重新加载的时候发现还有:
严重: The web application [/codeMarket] registered the JBDC driver[com.mysql.jdbc.Driver] but failed to unregister it when the webapplication was stopped. To prevent a memory leak, the JDBC Driverhas been forcibly unregistered.
2012-2-9 17:43:12 org.apache.catalina.loader.WebappClassLoaderclearReferencesJdbc
检查了一下jar包
- 解决memory leak问题
- 解决memory leak问题
- 解决memory leak问题
- [转] 解决 iphone的 memory leak 问题
- 解决tomcat报错memory leak问题
- 解决了困扰多日的Memory Leak
- 一则JVM memory leak解决的过程
- Memory Leak
- memory leak
- Memory leak
- Memory Leak(内存泄漏)问题总结
- Boost asio async_accept memory leak问题分析
- Memory Leak(内存泄漏)问题总结
- MFCButton Memory leak(内存泄露问题)
- [Android][Memory Leak] InputMethodManager内存泄露现象及解决
- 【有疑问,待解决】iOS 9 memory leak
- 性能优化之内存泄露(Memory Leak)解决
- jquery1.42 $.ajax Memory Leak 内存泄露问题
- Eclipse:Add Maven Arch…
- Maven介绍(创建工程项目以及下载所…
- maven 项目出现 java.la…
- Maven构建的可重现性
- 常用插件的使用—grunt入门指南之三
- 解决memory leak问题
- struts2.1.8 tiles2.1或2.2…
- ssh项目 maven+tiles的错误体会+MY…
- html 中的LI标签
- Android-sharedUserId数据权限
- Android学习笔记之AndroidManifest…
- 请问如何设置img标签图片自…
- httpclient4的官网例子的详细解释
- JavaScript中将字符串转换为Date型数据