Search code examples
javamultithreadinganalyzerthread-dump

Thread Dump Analyzer


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.


Solution

  • You could use TDA - Thread Dump Analyser, a plug-in for Visual VM.

    Visual VM is free as well. I think this is your best choice.

    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.

    From Tools and tips for Sun JVM troubleshooting on ServerFault.