Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jmap supports ascii format for heap dump and binary dump format

Tags:

java

heap-dump

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

like image 467
uuidcode Avatar asked Dec 09 '25 03:12

uuidcode


2 Answers

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

  • Recommendations for a heap analysis tool for Java?
like image 91
Tomasz Nurkiewicz Avatar answered Dec 10 '25 18:12

Tomasz Nurkiewicz


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

like image 32
jcomeau_ictx Avatar answered Dec 10 '25 16:12

jcomeau_ictx



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!