How to collect performance data on Windows
Collect the following information when high CPU consumption is with IBM Java process:
- From the Start menu, select Programs > Administrative Tools > Performance Monitor. (Alternatively, you might find Start > Settings > Control Panel, double-click Administrative Tools, and double-click Performance to open the Performance Monitor tool). A new performance monitor window titled Performance will be opened.
- Performance data can be captured to a log file. The log file can be forwarded to a location for analysis and rerun through the performance monitor. From the performance monitor window, expand Performance logs and alerts, right-click Counter Logs, New Log Settings.
- Type a log setting name, then click OK. A new window titled with the name you provided will now be opened.
- Click Add to add counters on the window opened in the above step. A new window titled Add Counters will now be opened.
- In the Performance Object drop down, select Thread as Object.
- Click Select counter from List (default), then select the following counters:
% Processor Time
ID Process
ID Thread
- Click Select instances from list and select all Java threads as shown in this example:

- Select Add
- Select the Process performance object
- Select Virtual Bytes from the counters list
- Select the instance for the Java process to monitor

- Select Add
- Select the Memory performance object
- Select the Pages/sec counter

- Click Add to add new properties, then click Close.
- Adjust sample data interval. For example, if high CPU usage does not last longer than 1 second, it would be best to sample data every 1 second.
- Click Log Files tab and change Log file type to Text File(Comma delimited), then click Apply.
- If you want to keep binary log file type, you can run relog command to convert binary log file type to Text File(Comma delimited),
For example, relog logfile.blg -f csv -o logfile.csv

- Logging starts immediately.The log file icon turns green.
- While the performance data is being logged, gather relevant Performance Degradation documentation. You can get instructions for gathering performance degradation by selecting the appropriate link for your Application Server Version:
- Generate three javacore files, taken two minutes apart during high CPU consumption period.
This can be done by either:
- Using Ctrl-Break in a console window
- Using WSAdmin command if you are running WebSphere Application Server
- From the command prompt, enter the command wsadmin.bat to get a wsadmin command prompt.
Note: If security is enabled or the default SOAP ports have been changed, you will need to pass additional parameters to the batch file in order to get a wsadmin prompt. For example:
wsadmin.bat [-host host_name] [-port port_number] [-user userid[-password password] |
|
Note: You can connect wsadmin to any of the server JVM in the cell. After running the wsadmin command it will display the server process for which it has attached to. Depending on the process that it has attached to, you can get thread dumps for various JVMs. If wsadmin is connected to deployment manager, then you can get thread dumps for any JVM in that cell. If it is attached to a node agent, then you can get thread dumps for any JVM in that Node. If it is attached to a server, then you can get thread dumps only for the server to which has connected to. |
|
- Get a handle to the problem application server.
Note: The contents in brackets "[.....]", along with the brackets, is not optional. It must be entered to set the jvm object. Also, note that there is a space between the words "completeObjectName" and "type":
wsadmin> set jvm [$AdminControl completeObjectName type=JVM,process=server1,*] |
|
Where server1 is the name of the application server that does not respond (or is hung). If wsadmin is connected to a Deployment Manager and if the server names in the cell are not unique, then you can qualify the JVM with node attribute in addition to process. |
|
- Generate the thread dump:
wsadmin>$AdminControl invoke $jvm dumpThreads |
|
- Wait 2 minutes.
- Generate the thread dump:
wsadmin>$AdminControl invoke $jvm dumpThreads |
|
- Wait 2 minutes.
- Generate the thread dump:
wsadmin>$AdminControl invoke $jvm dumpThreads |
|
- The preceding steps should have created 3 javacores which should be created in the installation root directory (for example, WebSphere\AppServer).
Collect the following files
- The perfmon log in Text File type
- The javacore*.txt files
If you want to analyze the Java thread dumps, download the IBM Thread and Monitor Dump Analyzer for Java (TMDA). TMDA is one of top alphaWorks technologies that can analyze thread dumps from Java virtual machine. It is useful for identifying deadlocks, contention, bottlenecks, and to summarize the state of threads within Java virtual machine.
If garbage collection activity seems to be causing performance degradation or high processor time consumption, Verbose GC logging can be enabled.
Enabling the generation of Verbose GC logging is done using the command line option: -verbose:gc. This causes the Verbose GC logging to be written to stderr or stdout.
If you want to analyze the Java Verbose GC log, download the IBM Pattern Modeling and Analysis Tool for Java Garbage Collector (PMAT). PMAT is one of top alphaWorks technologies that can parses verbose GC trace, analyzes Java heap usage, and recommends key configurations based on pattern modeling of Java heap usage.