jhat requires heap dumps in binary format. This is documented in the
troubleshooting guide and on the man page.
If a user tries to run jhat on an ASCII format file, they will see:
% jhat java.hprof.txt
Reading from java.hprof.txt...
java.io.IOException: Version string not recognized at byte 18
at com.sun.tools.hat.internal.parser.HprofReader.readVersionHeader(HprofReader.java:369)
at com.sun.tools.hat.internal.parser.HprofReader.read(HprofReader.java:161)
at com.sun.tools.hat.internal.parser.Reader.readFile(Reader.java:79)
at com.sun.tools.hat.Main.main(Main.java:143)
jhat should print a user-understandable message. Maybe something like:
This is an ASCII format JAVA PROFILE 1.0.1 file. jhat requires binary
format heap dump files.
troubleshooting guide and on the man page.
If a user tries to run jhat on an ASCII format file, they will see:
% jhat java.hprof.txt
Reading from java.hprof.txt...
java.io.IOException: Version string not recognized at byte 18
at com.sun.tools.hat.internal.parser.HprofReader.readVersionHeader(HprofReader.java:369)
at com.sun.tools.hat.internal.parser.HprofReader.read(HprofReader.java:161)
at com.sun.tools.hat.internal.parser.Reader.readFile(Reader.java:79)
at com.sun.tools.hat.Main.main(Main.java:143)
jhat should print a user-understandable message. Maybe something like:
This is an ASCII format JAVA PROFILE 1.0.1 file. jhat requires binary
format heap dump files.