3

I use jmap to dump heap memeory

jmap -dump:format=b,file=test.hprof 22035

as far as I know, heap dump ascii format exists. but execute below command

jmap -dump:format=a,file=test.hprof 22035

jmap Usage printed.

ASCII format doesn't exist?

And I like to know heap dump binary format documentation. googling.. there is no answer, no documenation.

Here is the snippest of binary format file. enter image description here

uuidcode
  • 3,790
  • 3
  • 25
  • 30

2 Answers2

2

There is no text format, only:

-dump:<dump-options> to dump java heap in hprof binary format
                     format=b     binary format

This makes sense, dumping memory of JVM in text format would take lots of GiB... This file can be read by heap dump analyzers like Eclipse mat or JProfiler.

See also

Community
  • 1
  • 1
Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674
1

just pipe the binary output through a filter like less (has various options for display of control characters), or xxd, which does a hexdump and ASCII dump by default.

there can be no true ASCII format since this is binary data; ASCII doesn't include any byte with bit 7 set, which would leave out a lot of important information.

some documentation is here: http://java.sun.com/developer/technicalArticles/Programming/perfanal/java.hprof.txt

jcomeau_ictx
  • 37,688
  • 6
  • 92
  • 107