Thread Dump Analysis with Samurai

7.3k views Asked by At

I tried to use Samurai to analyze my thread dumps.

I saved a thread dump from Java VisualVM, which gives a .tdump file. Then I started Samurai with

java -jar samurai.jar

I draged my thread dump file into Samurai and got the following error in the console:

java.lang.ArrayIndexOutOfBoundsException: 0
    at samurai.swing.ThreadDumpPanel$7.run(ThreadDumpPanel.java:634)
    at samurai.swing.LogRenderer.invokeLater(LogRenderer.java:78)
    at samurai.swing.ThreadDumpPanel.updateHtml(ThreadDumpPanel.java:629)
    at samurai.swing.ThreadDumpPanel.access$300(ThreadDumpPanel.java:61)
    at samurai.swing.ThreadDumpPanel$8.onFullThreadDump(ThreadDumpPanel.java:665)
    at samurai.core.ThreadDumpExtractor.fullThreadDumpEnded(ThreadDumpExtractor.java:175)
    at samurai.core.ThreadDumpExtractor.finish(ThreadDumpExtractor.java:151)
    at samurai.swing.ThreadDumpPanel.logEnded(ThreadDumpPanel.java:688)
    at samurai.tail.MultipleLogWatcher.logEnded(MultipleLogWatcher.java:96)
    at samurai.tail.SingleLogWatcher.logEnded(SingleLogWatcher.java:212)
    at samurai.tail.SingleLogWatcher.checkUpdate(SingleLogWatcher.java:123)
    at samurai.tail.Tailer.run(Tailer.java:56)
Saving configuration.[/Users/test/.samurai.properties]

What do I have to do to make Samurai running without the error?

2

There are 2 answers

0
Tomas Hurka On

I cannot help with Samurai problem, you can try to use TDA plugin for VisualVM. TDA should be able to provide same information as Samurai.

0
Jim T On

Tools like fastThread.io can group stack trace of all the threads and generate one single call stack tree. You can drill down & up on this tree to see the critical code path. Below is the sample call stack tree generated by ‘fastThread.io’. You are welcome to go here to see the call stack tree from a live report.

How to identify critical code path?