Finding database connection leaks

Questions about YourKit Java Profiler
Post Reply
cain
Posts: 4
Joined: Fri Oct 09, 2015 2:45 pm

Finding database connection leaks

Post by cain »

We seem to be having issues in our application with database connections being leaked and I'm trying to find the cause. We have hsqldb set up as an xa-datasource in Wildfly and are accessing it via JPA with hibernate as our persistance provider. I can reproduce the problem, but unfortunately I can't tell exactly where the leak is coming from since there's many connections being created for the steps to re-produce the leak and it seems all but one connection is closed/returned to the pool. I've tried doing a memory profile and looking for allocations of org.hsqldb.jdbc.pool.JDBCXAConnection, but YourKit doesn't seem to be able to provide me with that information. I can get an object count, but no allocations, it just says <Objects without allocation information>. Is there a way to get more information on database connections to assist with finding the issue? Thanks.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Finding database connection leaks

Post by Anton Katilin »

Did you record object allocations?
https://www.yourkit.com/docs/java/help/allocations.jsp

If yes, please change the "record each N-th" parameter from the default 10 to 1.

Also, you can use the Events tab to see where individual connections are created.
https://www.yourkit.com/docs/java/help/probes_ui.jsp

Please note that probes must be active - see activity modes:
https://www.yourkit.com/docs/java/help/ ... probes.jsp
cain
Posts: 4
Joined: Fri Oct 09, 2015 2:45 pm

Re: Finding database connection leaks

Post by cain »

Sorry for the late reply. I managed to get the issue resolved before your response, but I'll keep note of it for future reference. Thanks.
Post Reply