NonStop Server for Java Programmer's Reference (NSJ 4.0+)

Running the HPROF Java Profiler
To run the HPROF Java profiler, use the -Xrunhprof option on the java command. The format is:
java -Xrunhprof:[help]|[option=value, ...]
Use the following java command to get a listing of HPROF help, which displays option-value pairs you can
use with NonStop Server for Java 4.
java -Xrunhprof:help
Option Name and Value Description Default
--------------------- ----------- -------
heap=dump|sites|all heap profiling all
cpu=samples|times|old CPU usage off
monitor=y|n monitor contention n
format=a|b ascii or binary output a
file=<file> write data to file java.hprof(.txt for ASCII)
net=<host>:<port> send data over a socket write to file
depth=<size> stack trace depth 4
cutoff=<value> output cutoff point 0.0001
setup=<file> options from file <none>
special Print help on special sampling options
lineno=y|n line number in traces? y
thread=y|n thread in traces? n
doe=y|n dump on exit? y
For example,
java -Xrunhprof:cpu=samples,file=log.txt,depth=3 FooClass
HPROF Output File
Three HPROF examples appear below: CPU samples, CPU times, and a heap for the sites profile. For details
about using HPROF output and interpreting these examples, search for HPROF on the Web. Also, see the paper
Diagnose common runtime problems with hprof
(http://www.javaworld.com/javaworld/jw-12-2001/jw-1207-hprof.html).
Example 1: cpu=samples
TRACE 62:
WorkClass.doSomeWork(WorkClass.java:12)
TestClass.getNew(TestClass.java:16)
...........
CPU SAMPLES BEGIN (total = 331) Wed Dec 19 17:48:51 2001
rank self accum count trace method
1 5.14% 5.14% 17 29 java/util/Random.next
2 4.83% 9.97% 16 62 WorkClass.doSomeWork
3 4.23% 14.20% 14 30 java/util/Random.next
...........
CPU SAMPLES END