NonStop Server for Java 7.0 Programmer's Reference
The following message is displayed.
eprof: starting profiling
Allow the profiling to continue for a desired length of time.
4. Stop the profiling interval by sending the same signal to the JVM:
kill -USR2 pid
The following message is displayed.
eprof: terminating profiling
writing profile data to ./filename.eprof
5. You can now open the saved file in the HPjmeter console and view the collected metrics.
The HPROF profiler
HPROF is a profiling agent that is based on a profiling interface called JVMTI. By using HPROF,
you can get information about your application's CPU usage, heap allocation, and threads. This
agent creates profile data files that can be interpreted after the program terminates. Currently
HPjmeter can read text and binary files.
To run your application with profiling, use the following command:
$ java ... -agentlib:hprof[=options] ApplicationClassName
For more information on HPROF, see HPjmeter 4.3 User’s Guide available at www.hp.com/go/
hpjmeter and the Oracle documentation at http://docs.oracle.com/javase/7/docs/technotes/
samples/hprof.html.
NOTE: The following HPROF option is not supported on NSJ7:
—agentlib:hprof=cpu=samples
—Xeprof versus —agentlib:hprof (HPROF)
—Xeprof is a superior profiling tool compared to HPROF in terms of the richness of data. However,
Xeprof has a little higher performance impact on an application than HPROF. To take full
advantage of HPjmeter functionality, you can gather profiling data using –Xeprof for performance
tuning and —agentlib:hprof for memory tuning when you run your application. For a comparison
of the features of Xeprof and HPROF, before using either of the profiles, see Table 5-4 in the
HPjmeter 4.3 User’s Guide.
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 7.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:
i. Confirm that —Xverbosegc or —Xloggc option is not specified.
ii. Locate the process ID of the running Java application.
iii. Start the profiling interval. Send a signal to the JVM by typing the following command:
kill -ALRM pid or kill -14 pid
88 Application tuning and profiling










