Java Troubleshooting Guide for HP-UX Systems
heap dump file produced by one of the heap dump options such as
-XX:+HeapDumpOnCtrlBreak or -Xrunhprof:heap=dump,format=b.
The following example shows the use of jhat. The first command generates a binary heap dump
file. The second command executes jhat on the binary heap profile.
$ java -Xrunhprof:heap=dump,format=b MyApp
$ jhat -port=7002 java.hprof
The jhat tool sets up an http server on the specified port. It can then be accessed by bringing
up the default page in a Web browser, for example, http://<hostname.domain>:7002. If
you run hat on the same system as the browser, the server can be accessed by navigating to the
URL http://<hostname.domain>:7002.
For more information on jhat, refer to the following webpage:
http://java.sun.com/javase/6/docs/technotes/tools/share/jhat.html
1.16 jps (1.5+ only)
The jps tool lists the Java VMs on the target system. The tool is limited to reporting information
on Java VMs that the user has access rights to, as determined by HP-UX specific access control
mechanisms. For example, if a non-root user executes the jps command, a listing of all virtual
machines started with that user's uid is given by the operating system.
The following output is the usage information for the jps command:
Usage: jps [-help]
jps [-q] [-mlvV] [<hostname>[:<port>]]
Description of options:
-q Suppress the output of the class name, JAR file name, and arguments
passed to the main method, producing only a list of local JVM pids
-m Show the arguments passed to the main method. This output may be null
for embedded JVMs.
-l Show the full package name for the application's main class or the
full path nameof the application's JAR file.
-v Show the arguments passed to the JVM.
-V Show the arguments passed to the JVM through the flags file
(the .hotspotrc file or the file specified by -XX:Flags=<filename>).
Note: These options are subject to change or removal in the future.
The following example shows the use of jps:
$ /opt/java1.5/bin/jps -lmv
16666 sun.tools.jps.Jps -lmv
-Denv.class.path=.:/opt/java1.5/lib/classes.zip -Dapplication.home=/opt/java1.5 -Xms8m
16665 MyObjectWaiterApp -Xverbosegc
16641 spec.jbb.JBBmain -propfile S.pr.8 -Xmx1600m -Xms1600m -Xmn1500m
For more information about jps, refer to the following document:
http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jps.html
1.17 jstat (1.5+ only)
The jstat utility is a statistics monitoring tool. It attaches to a Java VM and collects and logs
performance statistics as specified by the command-line options. The target Java VM is identified
by its virtual machine identifier.
The jstat utility does not require the Java VM to be started with any special options. This utility
is included in the JDK download.
The following table lists the jstat command options:
40 Diagnostic and Monitoring Tools and Options