
Copyright © 2001, 2015, Oracle and/or its affiliates. All rights reserved.
JVM Tools
Console Logs
For the web and application servers, system monitoring utilities will only be partially effective since
the memory of a Java application is typically static and limited by the Java heap size. They will be
useful if multiple applications are being run on a single machine and the total physical memory may be
limited. If the entire Java heap cannot be contained in physical memory performance issues will be
very likely due to memory swapping during JVM garbage collection.
Memory monitoring within the Java heap can be performed by various Java monitoring tools or by
reviewing the verbose garbage collection output in the console.log files. You should have garbage
collection logging enable. This is done via one of the parameter settings in the “.conf” file for Tomcat,
WebLogic. Console logs for the web server and the application server should be reviewed to
understand the memory allocation and garbage collection.
Thread Dumps
Thread dumps are critical when diagnosing almost any performance issue. They are particularly useful
when diagnosing an issue where the application server is unresponsive. Thread dumps capture the
current state (executing, blocked, or inactive) and a stacktrace indicating the exact code that is being
executed for every thread. Thread dumps should be taken in a set of three thread dumps taken
consecutively at 30 second intervals. If the performance issue continues for an extended period of
time, it is extremely useful to capture multiple sets of thread dumps.
If there is very little activity in the thread dumps the cause of the performance issue may be fairly
apparent. However, if there are many active threads it may be very difficult to deduce the exact cause
of the performance issue. In this case, capturing the thread dumps during multiple occurrences of the
issue is necessary.
Heap Dumps
A heap dump is a dump of all the objects that are currently in the Java heap. The heap dump is a
critical piece of information when diagnosing a memory related issues. The heap dump can be
captured and then be analyzed off-line. Unfortunately the support and technique for capturing a heap
dump varies by JVM and version of the JVM. Oracle Support will help with capturing a heap dump
when it is necessary.
Capturing JRockit Mission Control JRA Files
Mission Control is a run-time analysis tool that is included with the JRockit JVM. This utility captures
and analyzes JRA (Java Run-time Analysis) files. This utility can be used to analyze performance,
memory heap usage, garbage collection, and thread latency. Mission Control imposes minimal
overhead on the running system and therefore can be used to analyze issues in a production
environment. If the issue you are experiencing only occurs sporadically it can be helpful to capture
JRAs both prior to the problem happening and while it is happening for comparison purposes. The
following steps can be used to capture a JRA.
1. Find the Process Id (PID) of the application server and keep it for the next step. You can do
this by running this command: <OTM_INSTALL_DIR>/jdk/bin/jrcmd –p
The <OTM_INSTALL_DIR>/jdk/bin/jrcmd –p command will list all of the java processes
running.
2. You can then make a jra recording from command line by running this command after
replacing the information in between the :
Comentarios a estos manuales