The man page says
If the given process is running on a 64-bit VM, you may need to specify the -J-d64 option
and that’s it. Some heap dump howtos do include it, without explanation.
More specifically, I’m trying to figure out if not specifying that option might be corrupting my heap dumps (jhat can’t read them). Experimenting blindly is costly, as the heap is large, the system is a live one, and there are specific points during operation at which I need the dump.
Snippet of
jmap‘s help message:So you see the
-Jflag passes arguments directly to the JVM.Look at the
jvmhelp message:So
jmap -J-d64is really tellingjmapto startjava -d64, using a 64-bit model instead of 32-bit.If the process you’re running
jmapon is not a 64-bit JVM, do not pass the-J-d64argument.edit since I have done a lot of
jmap/jhatto troubleshootWhen you say corrupted, do you mean
jhatactually reports a corrupted heap dump? Or is it because your heap dump is too large to read?jhatwill attempt to load the entirety of the dump into memory, so you will need at least as much free memory as the size of the dump. You might need to specify-Xmxtojhat, as well asJ-d64to increase the heap space.A much better alternative that I use is Eclipse Memory Analyzer Tool, which does selective loading of the heap dump rather than preload everything. It was much better on 6+ GB heap dumps than
jhatwas for me.