JDK-6488116 : jhat: give a meaningful error message when presented with an ASCII format heap dump
  • Type: Bug
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2006-10-31
  • Updated: 2015-05-08
  • Resolved: 2015-05-08
Description
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.

Comments
JHAT was removed with JDK-8059039, closing this as Won't Fix.
08-05-2015