NonStop Server for Java 6.0 Programmer's Reference

NOTE:
For information on analyzing profile data, see the HPjmeter 4.2 User’s Guide available at
www.hp.com/go/hpjmeter.
The instructions for using the HPjmeter tool on the NonStop platform are provided in “Addendum
to HPjmeter 4.2 User's Guide” (page 88).
Xeprof
The Xeprof option generates profile data for HPjmeter. Xeprof focuses primarily on
performance problems that characterize large server applications. It collects method clock and
CPU times, method call count and call graph, and lock contention statistics.
This option creates profile data file with a file extension .eprof. This file can be opened in the
HPjmeter console and the collected metrics can be viewed.
For more information on this option, see NonStop Server for Java 6.0 Tools Reference.
Zero Preparation Profiling
Profiling can be started from the command line by sending a signal to the Java process indicating
JVM to start eprof. Engaging zero preparation profiling may have a short term impact on application
performance as the JVM adjusts to the demands of performing dynamic measurements.
To collect profiling data without interrupting your application, perform the following from the
command line:
1. Confirm that no Xeprof option has been specified on the command line.
2. Find the process ID of the running Java application.
3. Start the profiling interval send a signal to the JVM by typing the following command: kill
USR2 pid
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.
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.2 User’s Guide available at www.hp.com/go/
and the Oracle documentation at http://docs.oracle.com/javase/7/docs/technotes/
Collecting profile data for analysis 77