问题
I sometimes have to look at thread dumps from a Tomcat server. However, this is a very slow process as my application uses thread pools with a couple of hundred threads. Most of the thread dumps I look at include the same stack trace for many of the threads as they are idle waiting for work.
Are there any tools which would parse a thread dump and only show me the unique stack traces along with a count of the number of threads in each state? This would allow me to quickly ignore the tens or hundreds of threads which are waiting in a common location for work.
I have tried the Thread Dump Analyzer but this doesn't do any summarisation of common stack traces.
回答1:
I have written a tool to do what I wanted.
Java Thread Dump Analysis Tool
回答2:
Haven't used it for a while but Samurai might be of interest.
回答3:
Here's an online tool that does exactly what you ask for, no installation necessary:
http://spotify.github.io/threaddump-analyzer/
来源:https://stackoverflow.com/questions/6417630/java-thread-dump-summarisation-tool