java anydata_java – Oracle驱动程序内存泄漏 – Tomcat

我们正在使用tomcat-7.0.33.

Spring 3.0.1和JPA使用tomcat JNDI数据源.使用ojdbc6.jar(最新)后端的Oracle 10g.

当我们尝试取消部署应用程序时,一些Oracle类似乎正在泄漏.我在使用旧的ojdbc14.jar驱动程序时没有看到这一点,但我们无法使用这些驱动程序,因为我们正在迁移到需要更新驱动程序的Oracle 11g.我猜这是Oracle驱动程序中的一个错误?有什么办法可以清理这些资源吗?我试过关闭数据库连接池和其他东西无济于事……

不使用Tomcat的连接池会更好吗?我们宁愿让服务器连接到数据库,但如果有必要,我们可以自己做…

Server控制台显示:

17505 INFO org.springframework.orm.jpa.LocalContainerEntityManagerfactorybean – Closing JPA EntityManagerFactory for persistence unit ‘myManager’

17515 INFO org.apache.tiles.access.TilesAccess – Removing TilesContext for context: org.springframework.web.servlet.view.tiles2.SpringTilesApplicationContextFactory$SpringWildcardServletTilesApplicationContext

Dec 06,2012 6:41:29 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks

SEVERE: The web application [/myApp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@1468544]) and a value of type [java.lang.Class] (value [class oracle.sql.AnyDataFactory]) but Failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

Dec 06,2012 6:41:29 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks

SEVERE: The web application [/myApp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@d73b31]) and a value of type [java.lang.Class] (value [class oracle.sql.TypeDescriptorFactory]) but Failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

Dec 06,2012 6:41:29 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks

SEVERE: The web application [/myApp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@13aae39]) and a value of type [java.lang.Class] (value [class oracle.sql.TypeDescriptorFactory]) but Failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

Dec 06,2012 6:41:29 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks

SEVERE: The web application [/myApp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@18443b1]) and a value of type [java.lang.Class] (value [class oracle.sql.AnyDataFactory]) but Failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

Dec 06,2012 6:41:34 PM org.apache.catalina.startup.HostConfig deleteRedeployResources

INFO: Undeploying context [/myApp]

我已经尝试添加ContextListener手动关闭我们的DBCP连接,但这没有帮助.

InitialContext initial = new InitialContext();

DataSource ds = (DataSource) initial.lookup("java:/comp/env/jdbc/myDS");

if (ds.getConnection() == null) {

throw new RuntimeException("I Failed to find the datasource");

}

LOG.debug("Found datasource. Closing...");

BasicDataSource bds = (BasicDataSource) ds;

bds.close();

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值