File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JBoss/WildFly and the fly likes Finding Connection Leaks Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Finding Connection Leaks " Watch "Finding Connection Leaks " New topic

Finding Connection Leaks

Mike Fourier

Joined: Apr 02, 2008
Posts: 25
Jboss 3.2.6 on linux 2.6.8 using JVM 1.4.2_06-b03

Ok, I'm not sure of the proper terminology for these things, so I'll just hope this is enough info.

JMX Console:

Domain: jboss.jca
service: LocalTxCM
name: fooDS

On that page, there are two links to other MBeans, CachedConnectionManager and ManagedConnectionPool.

Clicking through to the ManagedConnectionPool, I see that slowly but surely as time goes by, the AvailableConnectionCount approaches zero. If I ever do let it reach zero, the Help Desk email start up immediately with "I can't login!", etc, etc. All I need to do, at the bottom of the page, is click the 'Invoke' button for the flush() method. Then it shoots back up to 100. So I obviously have some sort of leak.

I used to have to do this at least 2-3 times per week. We've just deployed an upgrade, and all day yesterday the pool sat at 100. Ooops, this morning I see it's at 93. So there must still be some leaks.

Now I turn to CachedConnectionManager. There is an 'invoke' button for the method listInUseConnections(). Hopefully this will give me some clues as to where the "in use" (but actually leaked) connections are.

Holy doodle! The 'InUseConnections' attribute says 536!! And the listing I get is huge! (536 stack traces).

Our connection pool is supposed to be 100. But 'in use connections' are far in excess of that. What am I not understanding?
Mike Fourier

Joined: Apr 02, 2008
Posts: 25
Just thought I'd bump this.

Is anyone experienced in finding connection leaks in JBoss-hosted (EJB) applications?

Googling, I see things that surround those classes I mentioned:

But I'm not sure why I'm getting 500+ listings when I click the 'InUseConnections'. Clearly this doesn't mean what I think it means.
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

kishore routhu,
Your post was moved to a new topic.

[My Blog] [JavaRanch Journal]
I agree. Here's the link:
subject: Finding Connection Leaks
jQuery in Action, 3rd edition