Oracle driver memory leak - Tomcat

随声附和 提交于 2019-11-30 20:26:18

Figured out the issue... Toni had a good suggestion (but de-registering the driver meant that when the app reloaded the driver was no longer available!).

In our case we were accidentally including ojdbc6.jar with our web app AND in the Tomcat/lib directory. This pressumably caused Tomcat to use our classloader to create objects. Thus when our application was being unloaded Tomcat's DBCP pool still had open handles to classes in our application.

Removing ojdbc6.jar from our WEB-INF/lib solved the problem.

Toni Toni Chopper

In the listener you have also to de-register the JDBC driver (i.e. ojdbc5.jar or what you are using).

See this SO question for the code snippet.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!