Following on from last weeks post Hang or loop ? Let's start the Health Center agent this post will show how to use Health Center to generate a dump that we will then use to diagnose the problem. The rest of this post assumes you have the Health Center agent active on your target application either by using the method described last week, or by having the -Xhealthcenter parameter specified on your java command line.
Health Center can be run as part of the IBM Support Assistant but as of today it can also be installed directly into your own installation of Eclipse as it is available on the Eclipse Marketplace, I'll quickly run through installing it using this new method.
I'm running Eclipse Kepler on my Ubuntu 64bit and so there is already a link to the Eclipse Marketplace on the Help menu. Admitedly, finding Health Center via the search field was slightly problematic (I'll see if we can get that fixed) so instead I selected "Tools" and "Profiling" for the Market and Category, scrolled down to
"IBM Monitoring and Diagnostic Tools for Java - Health Center 2.2" and clicked Install. On the next panel make sure Health Center and Health Center Core are both selected, read and agree to all the terms and conditions and let the install begin.
Whilst that is downloading and installing I'll just mention that Health Center is part of the free suite of tools provided by IBM, more information is available here.
OK, it should all be installed by the time you've got to this point (yes it is a small download and install using this method !) and Eclipse restarted, so let's take a quick look at what we have (more blog posts on various aspects of Health Center will appear over the coming year). Health Center ships a number of different perspectives, each of which are designed to look at a different aspects of the running JVM that it connects to. The main starting point is the Status Summary so select Window->Open Perspective->Other and select the Health Center Status Summary. This will show you greyed out links to all the other persepectives which will become active links when we are connected to the agent running on your application.
To connect select File->New Connection from the menubar and the wizard will guide you through making the connection. For this example we assume the simple case where we are running on the same machine as the target application so just keep clicking Next and it will list all the ports on which it has found the agent - hopefully the port that was displayed when the agent was started in the previous post will appear, this is typically 1972.
When it connects, the Connection window will show data is being received and once the Health Center client has enough to provide data for each of the Health Center perspectives, the relevant links on the Status Summary will become active. If you want to check that you have connected to the correct agent I suggest you look at the Environment perspective where it will show the command line used to start this target JVM.
For this particular case we are going to use Health Center to get the target application to take a dump so on the menubar select Monitored JVM->Request a dump
You will be presented with three checkboxes and for this example we will select System Dump and Java Dump.
System Dump is a traditional operating system core file/dump of the address space and contains everything in that address space. It will contain the JVM, the Java heap and all the details and contents of all the objects on the Java heap. This is the perfect file to analyze and will be the one the rest of this series of posts uses.
Java Dump is a text file with a human-readable summary of the various parts of the JVM. It is useful for getting a quick overview of what is happening in the JVM and we'll use it for reference.
When the dumps are created a popup should tell you where they were written to and their names. The location depends on system setup and other options in force when the application was started but are typically the home directory of the user that started the application in question.
The next post in this series will start to show how to analyze the System Dump.