从正在运行的Programm或Java转储中获取死锁检测 [英] Get deadlock detection from running programm or dump in Java

查看:133
本文介绍了从正在运行的Programm或Java转储中获取死锁检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个正在运行的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.

是否有一些我可以提供PID的工具,它可以告诉我当前每个线程的位置以及变量的一些值?我正在运行linux.

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.

有什么想法吗?

推荐答案

实际上,您可以尝试使用 visualvm +其线程监视插件.您还可以进行线程转储,查看线程堆栈跟踪及其状态.您还可以使用 jconsole 来检测死锁.这两个工具都是JDK的一部分.

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.

此处是有关使用visualvm的更多信息用于线程分析.

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

这篇关于从正在运行的Programm或Java转储中获取死锁检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆