Fully featured low overhead profiler for Java EE and Java SE platforms.
Ultimate profiling and monitoring solution for Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

Finding database connection leaks

Moderators: Vladimir Kondratyev, Anton Katilin

Finding database connection leaks

Postby cain » Fri Oct 30, 2015 1:05 pm

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.
cain
 
Posts: 4
Joined: Fri Oct 09, 2015 2:45 pm

Re: Finding database connection leaks

Postby Anton Katilin » Fri Oct 30, 2015 4:05 pm

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
Anton Katilin
 
Posts: 5575
Joined: Wed Aug 11, 2004 8:37 am

Re: Finding database connection leaks

Postby cain » Wed Nov 04, 2015 3:02 pm

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.
cain
 
Posts: 4
Joined: Fri Oct 09, 2015 2:45 pm


Return to Java Profiler

Who is online

Users browsing this forum: Google [Bot] and 6 guests

cron