Thursday, May 30, 2013

Working With Thread Logic : A Thread Dump Analysis Tool

Thread Dump analysis is key tool for analyzing the Performance issues and troubleshooting many Issues. Currently available tools like samurai says about the state of the Thread , they does not give detailed view of what a thread is doing.

In most cases , they dont mention what was happening inside a Thread , whether they are critical or normal. Are there any optimization's that can be performed on these.

ThreadLogic is a Tool which provides options for performing the above.Thread Logic Comes in a form of Jar File.We need to manually run the file using “java -jar threadLogic.jar”

Once the GUI is open , we can select a Thread Dump file to open. Once you open a file the starting screen will be like

We can see all the Threads , threads which are waiting for Monitors, sleeping threads , locking threads e.t.c.

Once we click on the Dump No.1 , we can see a Information about the Thread Dump and also about the Threads information below like

The main important one is the “Advisory level”.Once a thread dump is parsed and threads details are populated, each of the thread is then analyzed against matching advisories and tagged appropriately.

If you click on the “Advisory map” link you can see

Which gives you various level of information.

Each of the advisory has a health level indicating severity of the issue found, pattern, name, keyword and related advice.

If you click on the Threads with an health (consider Fatal ) , we can see information regarding the thread like

Thread Logic also gives an advice on how to handle that. The Advisory gets trigged based on either call execution patterns that are found inside the thread stack of by other conditions inside the Thread Dump

The health levels (in descending of severity) are FATAL (meant for Deadlocks, STUCK, Finalizer blocked etc), WARNING, WATCH (worth watching), NORMAL and IGNORE.

Thread Groups
The threads are associated with thread groups based on the functionality or thread names. We can see thread Groups like

As we can see this is a Weblogic Thread dump , there is a group which says “WLS Thread Groups” with 40 threads. Clicking on the Groups gives you more insight like

One can see the thread groups are divided into two buckets - WLS and non-WLS related threads. The JVM threads, LDAP and other unknown custom threads go under the non-WLS bucket while all the WLS, Muxer, ADF, Coherence, Oracle, SOA, JMS, Oracle Adapter threads are all under the WLS bucket.

Using Thread Logic We can get more Information on how Threads Especially In Weblogic Work.

Happy learning :-)