java - 线程转储分析器

标签 java multithreading analyzer thread-dump

<分区>

你知道一些好的线程转储分析器工具吗?完美的是:

  • 免费
  • 可以阅读一些线程转储并进行比较
  • 指出哪些线程花费的时间最长,线程被锁定在哪些类上等。
  • 显示线程、锁、死锁和等待获取单个锁的多个线程

编辑:

  • 离线分析 - 使用一个或多个线程转储加载文件并对其进行分析。

编辑: 我的选择是:武士。它具有我需要的所有功能:加载日志文件,并比较几个线程转储。分析一下并指出:

  • 等待线程
  • 阻塞线程
  • 阻塞线程
  • 僵局

我会将问题保留为已回答,因为 TDA 是给出的最佳答案。

最佳答案

您可以使用 TDA - Thread Dump Analyser,一个用于 Visual VM 的插件。

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.

来自 Tools and tips for Sun JVM troubleshooting在 ServerFault 上。

关于java - 线程转储分析器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13375105/

相关文章:

multithreading - 使用多线程从URL下载文件

linux - 在 Linux 上,如何确保解锁锁定在死亡/终止线程中的互斥量?

c++ - boost::wait 和 boost::condition 是否必须共享相同的互斥对象

java - 使用 JNDI + Weblogic 的 Hibernate 数据源

java - 如何将 perl 脚本嵌入到 jar 文件中执行?

java - log4j 日志文件不更新

elasticsearch - 是否对ElasticSearch文档ID进行评分?

java - 渲染循环条件 LIBGDX

elasticsearch - 首先获取包含搜索词的文档,然后获取其同义词[Elastic]

elasticsearch - ngram Elasticsearch