title: HPjmeter-like graphical tool to view -agentlib:hprof profiling output
body: <p>What tools are available to view the output of the built-in JVM profiler? For example, I'm starting my JVM with:</p>
  
  <pre><code>-agentlib:hprof=cpu=times,thread=y,cutoff=0,format=a,file=someFile.hprof.txt
  </code></pre>
  
  <p>This generates output in the hprof ("JAVA PROFILE 1.0.1") format.</p>
  
  <p>I have had success in the past using <a href="http://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPJMETER" rel="noreferrer">HPjmeter</a> to view these output files in a reasonable way. However, for whatever reason the files that are generated using the current version of the Sun JVM fail to load in the current version of HPjmeter:</p>
  
  <pre><code>java.lang.NullPointerException
      at com.hp.jmeter.f.jb.a(Unknown Source)
      at com.hp.jmeter.f.a.a(Unknown Source)
      at com.hp.c.a.j.z.run(Unknown Source)
  Exception in thread "HPeprofDataFileReaderThread" java.lang.AssertionError: null pointer exception from loader
      at com.hp.jmeter.f.a.a(Unknown Source)
      at com.hp.c.a.j.z.run(Unknown Source)
  </code></pre>
  
  <p>(Why would they obfuscate the bytecode for a free product?!)</p>
  
  <p>Two questions arise from this:</p>
  
  <ol>
  <li>Does anyone know the cause of this HPjmeter error? (<strong><em>EDIT</strong>: Yes--see below</em>)</li>
  <li>What other tools exist to read hprof files? And why are there none from Sun (are there)?</li>
  </ol>
  
  <p>I know the <a href="http://www.eclipse.org/tptp/" rel="noreferrer">Eclipse TPTP</a> and other tools can monitor JVMTI data on the fly, but I need a solution that can process the generated hprof files after the fact since the deployed machine only has a JRE (not a JDK) intalled.</p>
  
  <p><strong>EDIT</strong>: A very helpful HPjmeter developer replied to my <a href="https://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1329103" rel="noreferrer">question on an HP ITRC forum</a> indicating that <code>heap=dump</code> needs to be included in the <code>-agentlib</code> options temporarily until a bug in HPjmeter is fixed. This information makes HPjmeter viable again, but I will still leave the question open to see if anyone knows of any other tools.</p>
  
  <p><strong>EDIT</strong>: As of version 4.0.00 of HPjmeter (available 05/2009) this bug has been fixed.</p>