Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
990 views
in Technique[技术] by (71.8m points)

jvm - Get deadlock detection from running programm or dump in Java

I have a piece of running java software that is jammed. I would like to get a view inside but have got no idea how to do that.

Is there some tool that I can give a PID and it will tell me where every thread is currently located and maybe a few values of the variables as well? I'm running linux.

I more or less know what is causing the problem, but there a still a few possible cases, therefor pinpointing it would be nice.

I can't reproduce the error because it only appears every few days and never appeared while debugging, so this is a unique change of getting to know the enemy.

Any ideas?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Actually you can try to use visualvm + its threads monitoring plugin. You will be also able to make a thread dump, view thread stack traces ant their states. You can also use jconsole to detect deadlocks. Both tools are part of JDK. JConsole

Here is some more info on using visualvm for thread analysis.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...