Java Troubleshooting Guide for HP-UX Systems
https://hat.dev.java.net/doc/README.html
1.10 hprof
hprof is a simple profiler agent, which is shipped with the JDK, and used for heap and CPU
profiling. Note that there can be very high intrusion due to the hprof agent. Therefore, when
running on HP-UX, HP recommends using other profiling options first. (For example, use Xeprof
for performance profiling and +HeapDump for heap profiling use.)
To start hprof, use one of the following Java command lines:
$ java -agentlib:hprof[=options] appl_to_profile (JDK 1.5+)
$ java -Xrunhprof[:options] appl_to_profile (SDK 1.4.2.0+)
hprof supports a number of profiling options. Use java -Xrunhprof:help to display the
available options.
The following is an example hprof command to do heap profiling:
$ java -Xrunhprof:heap=dump Hello
The output file can be read into HPjmeter, jhat, or hat, depending on the format (binary or
ASCII).
The following is an example hprof command to do performance profiling:
$ java -Xrunhprof:cpu=samples Hello
For information about this tool on SDK 1.4 releases, refer to:
http://java.sun.com/j2se/1.4.2/docs/guide/jvmpi/jvmpi.html#hprof
For information about the updated version of this tool available on JDK 1.5+ releases, refer to:
http://java.sun.com/developer/technicalArticles/Programming/HPROF.html
1.11 java.security.debug System Property
The java.security.debug system property controls whether the security checks in the JRE
(Java Runtime Environment) print trace messages during execution. This option can be useful
when trying to determine why a SecurityException is thrown by a security manager. This
system property can be set to one of the following values:
• access — print all checkPermission results
• jar — print jar verification information
• policy — print policy information
• scl — print permissions assigned by the SecureClassLoader
The access option has the following sub-options:
• stack — include stack trace
• domain — dump all domains in context
• failure — dump the stack and domain that did not have permission before throwing the
exception
For example, to print all checkPermission results and trace all domains in context, set
java.security.debug to access,stack. To trace access failures, set it to access,failure.
The following example shows the output of a checkPermission failure:
$ java -Djava.security.debug=”access,failure”
Application access denied (java.net.SocketPermission server.foobar.com resolve)
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1158)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:253)
at java.security.AccessController.checkPermission(AccessController.java:427)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1031)
at java.net.InetAddress.getAllByName0(InetAddress.java:1117)
at java.net.InetAddress.getAllByName0(InetAddress.java:1098)
at java.net.InetAddress.getAllByName(InetAddress.java:1061)
at java.net.InetAddress.getByName(InetAddress.java:958)
1.10 hprof 37