HPROF is a command-line profiling tool included with the RI's phoneME Advanced JVM.  For more information, see http://java.sun.com/developer/technicalArticles/Programming/HPROF.html

Some of the HPROF options on the RI don't result in output.  Monitor information is available by setting 'monitor=y' as described below.

In order to enable HPROF output on the RI's JVM, update mpeenv.ini and run the RI:

  • VMOPT.20=-agentlib:jvmtihprof=monitor=y
  • Create an empty jvm.hprof.txt file (or copy the file from the jvm source tree) in $OCAPROOT/bin/$OCAPTC/env/cvm/lib

Note that hprof options are provided on the agentlib line after jvmtihprof=

NOTES:

On windows, ctrl-c may not result in the file being generated if the runRI.sh script is used..instead, run the RI directly (ri.exe platform_win32.cfg). 

I was able to generate heap dump information using hprof with the format=b flags by rebuilding the crw Tracker classes and putting them on the bootclasspath.  However, I was unsuccessful in using JProfiler, JHat included with recent versions of the JDK, or the original Hat tool to parse this heap information.

  • No labels