Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Java™ Troubleshooting Guide for HP-UX Systems: > Chapter 1 Diagnostic and Monitoring Tools and Options

hprof

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

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

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2009 Hewlett-Packard Development Company, L.P.