java 线程转储分析器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13375105/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Thread Dump Analyzer
提问by Augustin Ghauratto
Do you know some good thread dump analyzer tool? Perfect would be :
你知道一些好的线程转储分析工具吗?完美的将是:
- free
- can read a few thread dumps and compare them
- point out which threads took the longest, what are the classes that the thread is locked on etc.
- shows threads, locks, deadlocks and multiple threads waiting to acquire a single lock
- 自由
- 可以读取一些线程转储并进行比较
- 指出哪些线程花费的时间最长,线程被锁定的类是什么等等。
- 显示线程、锁、死锁和等待获取单个锁的多个线程
Edit:
编辑:
- offline analyze - load file with one or many thread dump and analyze it.
- 离线分析 - 使用一个或多个线程转储加载文件并对其进行分析。
Edit:My choice is: Samurai. It has all the features I need: Loads logfile, and compares few thread dumps. Analyze it and points:
编辑:我的选择是:武士。它具有我需要的所有功能:加载日志文件,并比较几个线程转储。分析并指出:
- waiting threads
- blocked threads
- blocking threads
- deadlock
- 等待线程
- 阻塞的线程
- 阻塞线程
- 僵局
I'll leave question as answered because TDA is the best answer that was given.
我会留下问题,因为 TDA 是给出的最佳答案。
采纳答案by Shamis Shukoor
You could use TDA - Thread Dump Analyser, a plug-in for Visual VM.
您可以使用 TDA - Thread Dump Analyser,一个 Visual VM 插件。
Visual VM is free as well. I think this is your best choice.
Visual VM 也是免费的。我认为这是你最好的选择。
If you are on Linux you could use kill -3 to get a thread dump and look for deadlocks using using Thread Dump Analyzer.
VisualVM now ships as part of the JDK and can be used monitor memory usage, threads and also includes a profiler.
jmap can be used to obtain heap histograms and heap dumps from Java processes. You could then use a tool like Eclipse Memory Analyzer to investigate it.
As another answer mentioned you could look into JMX and JConsole. For each service in our application we have a MBean so we can view keys stats such as queue sizes to check if anything seems out of the ordinary.
如果您使用的是 Linux,您可以使用 kill -3 来获取线程转储并使用线程转储分析器查找死锁。
VisualVM 现在作为 JDK 的一部分提供,可用于监视内存使用情况、线程,还包括一个分析器。
jmap 可用于从 Java 进程获取堆直方图和堆转储。然后,您可以使用 Eclipse Memory Analyzer 之类的工具来调查它。
正如另一个答案所提到的,您可以查看 JMX 和 JConsole。对于我们应用程序中的每个服务,我们都有一个 MBean,因此我们可以查看关键统计信息,例如队列大小,以检查是否有任何异常。
From Tools and tips for Sun JVM troubleshootingon ServerFault.
来自ServerFault 上Sun JVM 故障排除的工具和技巧。
回答by trikelef
In case you use IBM JRE you should use IBM Thread and Monitor Dump Analyzer for Java, which offers exactly what you need (offline use, comparisons etc).
如果您使用 IBM JRE,您应该使用IBM Thread and Monitor Dump Analyzer for Java,它提供了您所需要的(离线使用、比较等)。
回答by user3490698
You could try my Dump Analyzer. I had the same need and developed my own dump analyzer. It has some of the features of your list.
你可以试试我的Dump Analyzer。我有同样的需求并开发了自己的转储分析器。它具有您列表中的一些功能。