Okay, that’s awkward ...
I start playing with the Eclipse Memory Analyzer to look for Java memory leaks in a Windows window. Step 1 - get the heap dump file. To do this, I start my Java (javaw.exe) process from Eclipse and connect to it using jconsole. Then, on the MBeans jconsole tab, click dumpHeap. The first time I did this, I saw a pop-up message stating that he had created a heap dump file but did not give its name or location. Now, when I do dumpHeap again when connecting to another javaw.exe process, jconsole says:
Problem invoking dumpHeap : java.io.IOException: File exists
and, of course, does not give his name or path. Where could it be?
I searched my C: drive (using cygwin command line tools) for files containing "hprof" or "java_pid" or "heapdump" and did not find anything believable. I even used Windows Search to search for all files in the Eclipse workspace that were changed on the last day.
I am using the Sun Java 1.6 JVM and do not have -XX: a set of HeapDumpPath.
Update (April 28, 2010):. My original heap file location should be determined by jconsole, from the tool from which I started the heap dump. The JVM heap dump location should only apply to heap dumps that it triggers (for example, in OutOfMemoryException).
Matt B's suggestion for using jvisualvm solves my problem perfectly, pointing me to a much more useful replacement for the old jconsole. It has a good memory profiler that shows which types of objects are the most numerous and store most of the memory. And it has a monitor that shows the actual memory usage over time. When you ask him about a heap dump, he even tells you the file name! The Eclipse memory analyzer gives you complete information.
source share