A couple of weeks ago, one of our users reported that Eclipse consistently froze when executing some action. I was hoping that Eclipse would have an editor where I can open the thread dump I got and navigate, through hyperlinks, from stack traces to source code. The closest thing I found was the “Java Stack Trace Console,” which provides hyperlinking to source code. It would have been nice if there is a specialized editor that provides the following features, besides code navigation:
- an Outline View that shows the threads by name (with icons representing their state) and any deadlocks found
- some basic syntax highlighting to make reading easier
- ability to collapse blocks (e.g. a thread or stack trace) to minimize noise
- navigation to thread definitions from references (e.g. a deadlock)
BTW, IntelliJ IDEA provides something somehow close to what I’m asking for since 2008! 2008!
Of course I had to scratch my own itch! This past weekend I finally had time to write my own “Thread Dump Viewer.” It is an editor that provides everything I described. I was able to write a working editor in a matter of hours, using Xtext. The key was getting the grammar right. I spent an additional couple of hours making it “prettier.”
Here is a screenshot of the editor (click to enlarge.)
Here is a demo showing off the features of the “Thread Dump Viewer.”
I created this tool for my own use. I haven’t open-sourced the code or made the plug-in publicly available simply because I don’t know if anybody else would find this tool useful. If you do, please leave a comment.
(10/07/12) Update: I’m in the process of open sourcing this plug-in. I need to do some cleanup (code formatting, add copyright headers, etc.) first. I expect the first version of the plug-in to be what I have now. Right after that, I’ll be implementing the features mentioned in the comments:
- detection of multiple threads locking on the same object
- compare multiple thread dumps with each other
Many thanks to everyone that left a comment! :)