4、使用示例

sudo ./jmap -dump:format=b,file=/tmp/917dump.dat 8949




If you take a look at the source code for <a href="http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/com/sun/tools/hat/internal/parser/Reader.java" rel="nofollow">com.sun.tools.hat.internal.parser.Reader</a>, you'll see that it's looking for the magic number <a href="http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/com/sun/tools/hat/internal/parser/HprofReader.java#HprofReader.0MAGIC_NUMBER" rel="nofollow">0x4a415641</a>.


This value is used to help identify valid heap dump files. <code>jmap</code> should append this value as the first four bytes of any heap dump file it creates.


http://stackoverflow.com/questions/15507047/jhat-throwing-unrecognized-magic-number


http://blog.csdn.net/gtuu0123/article/details/6039474