views:

54

answers:

1

Hi. Our J2ee server (which will remain nameless for embarrassment reasons) slows down drastically from time to time. I have managed to create a thread dump. And trying to analyze it. One of the things that I don't understand is some waiting on locks without finding the locking thread. Here is part of the stack trace of such thread:

waiting for monitor entry []
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:781)
- waiting to lock <0xsomenumber> (a org.apache.commons.pool.impl.GenericObjectPool)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)

The somenumber number is only wait upon. I don't see anything locking it. How can that be?

Thanks.

Update with some more detailed: the jdk version is 1.4.2.05

+2  A: 

Use JConsole in the JDK to attach to your application server and use the "Detect Deadlock" button on the Threads pane.

Thorbjørn Ravn Andersen
I have failed to mention that we are using jdk 1.4. So JConsole is not available.
Igal Serban
I would have a look at the code _releasing_ the database connections back to the connection pool. The symptoms you describe sounds like the pool running low on available connections.
Thorbjørn Ravn Andersen