Sun Java System Application Server Platform Edition 8.2 Developer's Guide

The HPROF Profiler

HPROF is a simple profiler agent shipped with the Java 2 SDK. It is a dynamically linked library that interacts with the JVMPI and writes out profiling information either to a file or to a socket in ASCII or binary format.

HPROF can present CPU usage, heap allocation statistics, and monitor contention profiles. In addition, it can also report complete heap dumps and states of all the monitors and threads in the Java virtual machine. For more details on the HPROF profiler, see the JDK documentation at

Once HPROF is enabled using the following instructions, its libraries are loaded into the server process.

ProcedureTo use HPROF profiling on UNIX

  1. Configure the Application Server using the Administration Console:

    1. Select the JVM Settings component under the relevant configuration, then select the Profiler tab.

    2. Edit the following fields:

      • Profiler Name: hprof

      • Profiler Enabled: true

      • Classpath: (leave blank)

      • Native Library Path: (leave blank)

      • JVM Option: For each of these options, select Add, type the option in the Value field, then check its box:


        Here is an example of options you can use:


        The file option determines where the stack dump is written in Step 2.

        The syntax of HPROF options is as follows:

        -Xrunhprof[:help]|[:option=value,option2=value2, ...]

        Using help lists options that can be passed to HPROF. The output is as follows:

        Hprof usage: -Xrunhprof[:help]|[:<option>=<value>, ...]
        Option Name and Value   Description             Default
        ---------------------   -----------             -------
        heap=dump|sites|all     heap profiling          all
        cpu=samples|old         CPU usage               off
        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
        lineno=y|n              line number in traces?  y
        thread=y|n              thread in traces?       n
        doe=y|n                 dump on exit?           y
  2. Restart the Application Server. This writes an HPROF stack dump to the file you specified using the file HPROF option in Step 1.