Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to trouble shoot deadlock  RSS feed

 
Durga Krishna
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

If a deadlock happens in my application,
how can I identify which class/object and due to which method it has been locked?

Basically I need to know how to trouble shoot deadlock. Where should I start from?
 
Istvan Kovacs
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If running a the console, try Ctrl + Break, it will produce a thread dump that shows what's locked - it will even show what threads and objects are involved.
In a debugger, you can suspend the application - for Eclipse:
http://runnerwhocodes.blogspot.com/2007/10/deadlock-detection-with-eclipse.html

You can also use JConsole.
Other ways (send Unix signal etc.):
http://stackoverflow.com/questions/217113/deadlock-in-java
http://wiki.eclipse.org/How_to_report_a_deadlock
 
Durga Krishna
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.

But, my application is in production. I want to check due to which class/Method deadlock has occured.
I am using JBoss Application server.
How can I do this?

Thanks in Advance.
 
Istvan Kovacs
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Durga Krishna wrote:Thanks for the reply.

But, my application is in production. I want to check due to which class/Method deadlock has occured.
I am using JBoss Application server.
How can I do this?

Thanks in Advance.


Connect to it using JConsole.
Or, on Unix/Linux, send signal 3 and check the output (probably in a log).
Ctrl+Break does not stop the application, BTW.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!