NonStop Server for Java 6.0 Programmer's Reference
NOTE: The following HPROF option is not supported on NSJ 6.0 :
-agentlib:hprof=cpu=samples
Obtaining Garbage Collection Data for Analysis
Garbage collection data can be collected in either one of the following two ways:
1. Data collection with —Xverbosegc.
Launch the Java application using the –Xverbosegc option. For more information on the
option, see NonStop Server for Java 6.0 Tools Reference.
2. Data collection with Zero preparation.
Data collection can be started from the command line by sending a signal to the Java process
to indicate JVM to start GC data collection.
To collect GC data without interrupting an already running application, perform the following
from the command line:
a. Confirm that —Xverbosegc or —Xloggc option is not specified.
b. Locate the process ID of the running Java application.
c. Start the profiling interval. Send a signal to the JVM by typing the following command:
kill -ALRM pid or kill -14 pid
d. The GC data is written to a file named java_pid.vgc in the current directory of the
JVM process.
Allow the profiling to continue for a desired length of time.
e. Stop the data collection interval by sending the same signal to the JVM:
kill -ALRM pid
f. You can now open the saved file in the HPjmeter console and view the collected metrics.
GC Log Rotation
HP’s Implementation
When GC logging is enabled using the -Xverbosegc or -Xloggc option, by default, the GC
data is written to a single log file of unlimited size. Starting with the NonStop Java 6.0
T2766H60^ABP release, NonStop Java supports controlling the size and number of the GC log
files. The GC log records are written into the specified number of GC log files in a round-robin
fashion. This allows GC data to be archived easily and helps to limit the amount of disk space
consumed by the GC log files. Log rotation is also supported when using zero-preparation
-Xverbosegc.
To enable log rotation, use the following option together with -Xverbosegc, -Xloggc, or
zero-preparation Xverbosegc:
-XX:GCLogLimits=M,N
where,
M is a non-negative integer that specifies the number of rotating GC log records
per file.
NOTE: Each GC log record corresponds to a GC event. A value of 0 specifies
an unlimited number of GC log records per file.
N is a non-negative integer that specifies the maximum number of rotating GC log
files. A value of 0 specifies an unlimited number of files.
78 Application Profiling










