Thursday, 24 July 2014

HOW TO: Debugging high CPU usage in a Maximo JVM (WebSphere\Windows).

Software Required:


Situation

A JVM in your Maximo environment is using a lot of CPU time.  Task Manager only shows basic information about the underlying java.exe process.


Step 1: Find the Thread ID

Download and run Process Explorer (procexp.exe).  Find the Java process with the high CPU usage and select Properties from the right-click menu options.

Click on the Threads tab. And find the thread with the high CPU usage.
ThreadID 8620 has the high CPU usage (2nd column)
.

Step 2: Obtain a JavaCore Heap dump

Open a command prompt and move to the WebSphere AppServer bin directory.  Run the wsadmin command (you will need to enter the WebSphere username and password)

By default you should be at teh Deployment Manager level.  Issue the following command to set the JVM that you want a thread dump from (in this example the JVM is MXPROD_UI2)

set jvm [$AdminControl completeObjectName type=JVM,process={JVM_NAME},*]
 Generate the heap dump with this command
$AdminControl invoke $jvm dumpThreads
The JavaCore file will be generated in the profiles/node folder.  It will generally be a few MB in size only

Step 3: Locate thread information in the dump file

Find the hexadecimal value of the ThreadID (TID).
 
TID 8620 = TID 0x21AC

Open the dump file in a text editor and search for the TID.   You should get a snippet of the stack trace that the TID is currently running.  In this example we can see that the high CPU usage has been caused by the Asset Location DrillDown dialog trying to load.