Skip to content

03. Thread Dump Parsing

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

Open the log file you want to analyse, TDA will search for all thread dumps in this log file and displays them in a tree. Up to Sun's JDK 1.5 the VM doesn't log any date information when the dump was requested, you can provide a regular expression in the Preferences which is then used for parsing the lines before the thread dump to get a time stamp (see below for an example). In JDK 1.6 a time stamp is logged just before the dump, the default regular expression is set up to parse this time stamp. In Regular Expression For Time Stamps you will find information about how to set up your own regular expression for time stamp parsing.

Information about the selected dump

For each thread dump TDA sums up all found threads and all monitors found in the threads, it also groups threads waiting on, for and locking monitors. Clicking on the dump nodes itself will provide you with information about the dump. If there is something special about it, TDA will give you some hints about what it found and what to do next.

Thread Dump View

If you want to focus on a lock found in a thread you can just click on the monitor, TDA will then expand the Monitor node of the thread dump and focuses the clicked monitor. It will also give you information about the monitor, if there is something special about, e.g. it has no obvious thread locking the monitor but others waiting for it.

Starting here you can easily see if a thread is hanging and holding a lock which a lot of other threads are waiting for. If there aren't any locking threads but only waiting threads it is very likely the garbage collector is locking the monitor currently. In this case you will get a hint telling you about this.

Monitors used by threads

If you added the -XX:+PrintClassHistogram to the VM-Parameters you will also see the class histogram for a thread dump, presented as node of the dump. Here you can examine all objects in the heap at the time of the thread dump. You can sort this view and filter it using the Filter Expression.

Class Histogram of selected dump

If you use the loggc option with your VM to log the garbage collection information into a different log file, the class histogram will go into this log file instead of standard out and the TDA will not find it by default. To add the class histogram from a loggc file you need to use Open loggc file... in the popup menu of the thread dump pane. TDA will then parse this file backward and adds the found class histograms to the thread dumps starting with the last dump. You can added multiple loggc-files, TDA will then continue after the last one where it added a class histogram with the last loggc-logfile or uses the dump you clicked on.

If your log file contains a lot of thread dumps done during one session of the VM, you can use Find long running threads in the tools menu to extract long running threads from the thread dumps. Currently this does also show waiting threads, so you need to search for threads actually doing something. Use appropriate filters to filter out all idle and uninteresting threads from the result.