Profiling Java Programs


Profiling is the measurement of runtime data for a specific application on a specific runtime system. The PJEE includes profiling support as a command-line option for the pjava application launcher.

Note: The profiling support in the PJEE is based on the Java Virtual Machine Profiler Interface (JVMPI). To support compatibility with the PJEE, third-party developer tools should support this interface.

The mechanics for using the profiler in the PJEE are very simple:

  1. Select an application for profiling.

  2. Choose a set of -Xhprof command line options for the profiler. See the pjava manual page for a list of command line options for the profiler.

  3. Run the application with pjava_g and the profiler options. For example,

    % pjava_g -Xhprof:monitor=y HelloWorld
    

  4. Examine the data in the profile report file. By default, the profiler generates an ASCII report file named java.hprof.txt.