-3

I have been trying to find whether JVM has some way to find if some threads are in deadlock condition. I am unable to find any. Please let me know if any one of you gets any pointer on this.

asked Nov 1, 2012 at 12:04
1

2 Answers 2

1

You can use the ThreadMXBean JMX bean.

ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
ThreadInfo[] threadInfos = threadMXBean.dumpAllThreads(true, true);
long[] deadlockedThreads = threadMXBean.findDeadlockedThreads();
long[] monitorDeadlockedThreads = threadMXBean.findMonitorDeadlockedThreads();
answered Nov 1, 2012 at 12:13
Sign up to request clarification or add additional context in comments.

Comments

0

No, the JVM itself does not support deadlock detection.
There is a thread that deals with JVM and deadlocks, which is also marked as resolved: Link

answered Nov 1, 2012 at 12:21

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.