Working with a Java console application, I can do this:
java -agentlib:hprof=heap=dump,format=b MyClass
Then I can hit ctrl-\ (or ctrl-break on Windows) any time I would like to take a snapshot of the heap for later analysis.
I would like to do the same thing for a Java Web Start application, but I cannot seem to get that to work. I can pass in the agentlib argument with the JAVAWS_VM_ARGS environment variable, but entering ctrl-\ and ctrl-break in the console doesn't seem to do anything. All I get is one dump, when the program starts, which isn't really interesting since at that point I haven't even logged into our program yet and executed the transactions I want to analyze.