Skip to content

04. Find Long Running Threads

Ingo Rockel edited this page Nov 16, 2017 · 1 revision

A common usecase for thread dump analysis is the long running thread detection. TDA offers some help for finding these long running threads. The "Find long running threads" option in the tools menu or from the popup menu in the main tree checks for long running threads in marked thread dumps in the main tree.

Find long running threads

The analysis is quite simple though, it just compares the thread names and if they match adds the thread to the result. A regular expression can be specified for filtering just the interesting threads. A common mistake in the regular expressions is to forget the " in the thread name, so if the thread name is something like AJPWorker-4711, usually something like this is required for regular expression: "AJPWorker-4711.*.

The usual filters are also applied to the result view of the analysis to filter out uninteresting threads. For a useful result appropriate filters should be specified to filter out all sleeping and uninteresting threads.

The long running threads detection is a bit picky about the selected nodes for the detection. You should only select thread dump root nodes otherwise the detection might through an exception as it doesn't know what to do with the selected nodes. You also always should select nodes from one VM run, otherwise you might get quite weird results because the detection matched threads from different VM runs.