<p>I have a production server running with the following flag: -<strong>XX:+HeapDumpOnOutOfMemoryError</strong></p>

<p>Last night it generated a java-38942.hprof file when our server encountered a heap error. It turns out that the developers of the system knew of the flag but no way to get any useful information from it.</p>

<p>Any ideas?</p>

You can use
JHAT
, The Java Heap Analysis Tool provided by default with the JDK.  It's command line but starts a web server/browser you use to examine the memory.  Not the most user friendly, but at least it's already installed most places you'll go.  A very useful view is the "heap histogram" link at the very bottom.
ex:
```
jhat -port 7401 -J-Xmx4G dump.hprof
```
```
jhat
```
can execute OQL "these days" as well (bottom link "execute OQL")