Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

How to trouble shoot deadlock

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 116
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 116
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic