Java Core Debugging Using IBM Thread and Monitor Dump Analyzer For Java
Java Core Debugging Using IBM Thread and Monitor Dump Analyzer For Java
Java
Abstract
Java Core Debugging using IBM Thread and Monitor Dump Analyzer for Java
Body
Abstract: Problems which cause Java processes to dump threads to a core file can be solved with the help of an
IBM DeveloperWorks tool created by Jinwoo Hwang.
Introduction
Some error conditions in an IBM® Java Virtual Machine (JVM) running under IBM WebSphere® Application
Server result in a crash. The output of a crash is a Java core file. The Watson Explorer Content Analytics
runtime is instrumented to output all running Java threads, at the time of a system-critical error. These core files
are written to the Content Analytics/logs directory and are included in the output of the command.
esservice.sh/bat
While it is true that the support team may ask for such files, it is also to do your own preliminary analysis. IBM
has published a detailed technote on Java core files and their analysis.
/support/pages/node/79127 (https://www.ibm.com/support/pages/node/79127)
It is a good idea for any Support engineer to read this article, perferably with an actual core file to refer.
However, the current article is simply to present you with an IBM tool, IBM Thread and Monitor Dump
Analyzer for Java. The home page of this tool is at:
https://www.ibm.com/developerworks/community/groups/service/html/communityview?
communityUuid=2245aa39-fa5c-4475-b891-14c205f7333c
(https://www.ibm.com/developerworks/community/groups/service/html/communityview?communityUuid=2245aa39-fa5c-4475-b891-14c205f
7333c)
ftp://public.dhe.ibm.com/software/websphere/appserv/support/tools/jca/jca457.jar
(ftp://public.dhe.ibm.com/software/websphere/appserv/support/tools/jca/jca457.jar)
Since Mr. Hwang's departure from IBM, the IBM HeapAnalyzer is now maintained by the WebSphere Application
Server Level 2 Support SDK team. The current developer is Thomas Ireton, any questions and concerns should
be routed to Thomas at tireton@us.ibm.com
Note: Of course, you must have a Java SDK, not simply a JRE – the JRE does not contain the functionality to
run a Java jar file.
Go to the File menu, Open Thread Dumps and navigate to a Java core file you want to analyze.
Figure 2
After the file has been loaded, be patient while the tool performs the analysis. After a short time, you will see:
Figure 3
It should be immediately apparent that there is a wealth of debugging details that you can use, including JRE
version and the operating system. More importantly, however, is that you know the process ID of the JVM that
crashed, but even more important is that the Anlayzer tells you the cause:
If we scroll down, we see that this JVM is configured with a very small heap:
It is unlikely that this heap could withstand much work. One quick fix would be to increase the Maximum Java
heap size for this JVM.
Additional information can be found in the Command-Line Arguments and Environment Variable Analysis
sections.
Figure 4
Figure 5
Support will be able to determine a lot from the current thread analysis -- the thread that was running when the
crash occurred:
Figure 6
In Content Analytics terms, this would likely pertain to the crawling/parsing process, which reads in raw byte data
and then pushes it to the parser.
The Garbage Collection history refers us back to the original cause of the core being thrown:
Figure 7
Figure 9
Often people confuse memory errors with CPU usage. If we look at the graphical CPU usage chart, it is obvious
that this crash had nothing to do with the CPU, which was virtually unused.
Figure 10
We should definitely take a look at Thread Analysis since it is a major feature of the tool. Of course, this type of
analysis requires a great deal of knowledge. Start by opening the Thread Status Analysis UI.
Figure 11
In this case we might assume that the JVM is getting hung – half the threads are waiting on some condition.
Figure 12
https://www-
01.ibm.com/support/knowledgecenter/SSYKE2_7.0.0/com.ibm.java.aix.71.doc/diag/tools/javadump_tags_thread
s.html
(https://www-01.ibm.com/support/knowledgecenter/SSYKE2_7.0.0/com.ibm.java.aix.71.doc/diag/tools/javadump_tags_threads.html)
There is one last view we will look at in this article. It gives a look at the ulimits on a Unix system.
Figure 13
Figure 14
It is frequently the case when running Content Analytics on a Unix system, that the ulimit is reached or
exceeded, with reference to the number of files that can be simultaneously opened. This is indicated by the
NOFILE argument in Figure 12, above, with hard and soft limits.
----------
Email: kameroncole@us.ibm.com
Bio: Kameron Cole is an unstructured information solutions architect. He was a WebSphere consultant for many years, but has become an expert in
IBM search technology over the past 10 years, in his role as Complex Solution Architect for the Content Analytics Platform