Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6614052
Votes 0
Synopsis jhat fails to read heap dump >2GB
Category java:serviceability
Reported Against b01 , b34 , b35
Release Fixed 6u10(b09), 7(b36) (Bug ID:2166793) , 6-open(b18) (Bug ID:2185799)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs 6746422
Submit Date 08-OCT-2007
Description
jhat fails reading very large (>2GB) heap dumps:

jhat -debug 1 ...

Read record type 2, length 16 at position 0x337c13
Read record type 2, length 16 at position 0x337c2c
Read record type 12, length -1452344221 at position 0x337c45
java.io.IOException: Bad record length of -1452344221 at byte 0x337c4a of file.
       at com.sun.tools.hat.internal.parser.HprofReader.read(HprofReader.java:192)
       at com.sun.tools.hat.internal.parser.Reader.readFile(Reader.java:79)
       at com.sun.tools.hat.Main.main(Main.java:143) 

This is an overflow: the  customer  (i.e. heap dump) size in the dump file is 2.7GB, which has been read as a signed int.


It is understood that the heap size requirements will be very large for jhat to read such a dump.  A 64-bit JVM will usually be needed.  e.g.  jhat -J-d64 -J-Xmx6g etc...
Posted Date : 2007-10-08 10:54:53.0

It turns out that this bug has been seen in nightly testing:

New vm.heapdump failures (from 2008.03.29)
    heapdump/JMapHeap
    heapdump/JMapPerm
    heapdump/OnOOMToFile
    heapdump/OnOOMToPath
        These tests failed due to "IOException: Bad record length of
        -174853360 at byte 0x45c9b06c of file." on Solaris AMD64 Server
        VM (machine intelsdv01).

        Update: JMapHeap and JMapPerm were executed in the 2008.03.30
            nightly on machine vm-v20z-5 and did not reproduce this
            failure mode.

        Update: JMapHeap and OnOOMToPath failed in the 2008.07.03
            nightly with this failure mode. In the same run, JMapPerm
            and OnOOMToFile failed due to 6650690.

        Last failure on 2008.07.03 with Solaris AMD64 Server VM (machine intelsdv01)
        Previous failure on 2008.03.29 with Solaris AMD64 Server VM (machine intelsdv01)


http://sqeweb.sfbay.sun.com/nfs/results/vm/gtee/JDK7/NIGHTLY/VM/2008-03-29/Serv_Baseline/vm/solaris-amd64/server/comp/vm-solaris-amd64_server_comp_vm.heapdump.testlist2008-03-29-22-27-49/analysis.html
http://sqeweb.sfbay.sun.com/nfs/results/vm/gtee/JDK7/NIGHTLY/VM/2008-07-03/Serv_Baseline/vm/solaris-amd64/server/comp/vm-solaris-amd64_server_comp_vm.heapdump.testlist2008-07-03-19-44-52/analysis.html
Posted Date : 2008-09-09 20:04:53.0
Work Around
N/A
Evaluation
Overflow, 32-bit unsigned value treated as signed.
Posted Date : 2007-11-28 15:07:55.0

http://hg.openjdk.java.net/jdk6/jdk6/jdk/rev/dd7969318d7a
Posted Date : 2009-12-08 22:14:29.0
Comments
  
  Include a link with my name & email   

Submitted On 16-JAN-2008
anipa
This doesn't seem to work for us at all:

 >java -version
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_03-b05, mixed mode)
 >jhat -version                     
jhat version 2.0 (java version 1.6.0_03)
 >jhat -J-d64 -J-Xmx6g snapshot.jmap
Reading from snapshot.jmap...
Dump file created Wed Jan 16 11:22:00 UTC 2008
java.io.IOException: Bad record length of -1627816209 at byte 0x3b62eb of file.
        at com.sun.tools.hat.internal.parser.HprofReader.read(HprofReader.java:192)
        at com.sun.tools.hat.internal.parser.Reader.readFile(Reader.java:79)
        at com.sun.tools.hat.Main.main(Main.java:143)

snapshot.jmap size is 2.48GB.


Submitted On 16-JAN-2008
anipa
Upgraded to 1.6.0_04 and it still will not open a file
larger than 2G.  Opens a file with size of 1.4G just fine.


Submitted On 16-JAN-2008
anipa
I don't think this is an issue with jvm 32/64 bit size.  This is
an issue with HprofReader.java using normal 32bit java
io functions.


Submitted On 04-FEB-2008
gcolpitts
I can't  open a 1g heap:
ls -l /tmp/*.hprof
-rw-r--r--    1 gcolpitt g680     10780873 Feb  4 12:00 /tmp/snapshot.hprof
jhat /tmp/*.hprof
Reading from /tmp/snapshot.hprof...
Dump file created Mon Feb 04 11:59:45 PST 2008
Snapshot read, resolving...
Resolving 249228 objects...
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
	at com.sun.tools.hat.internal.model.JavaLazyReadObject.intAt(JavaLazyReadObject.java:136)
	at com.sun.tools.hat.internal.model.JavaLazyReadObject.objectIdAt(JavaLazyReadObject.java:108)
	at com.sun.tools.hat.internal.model.JavaObject.parseFields(JavaObject.java:257)
	at com.sun.tools.hat.internal.model.JavaObject.resolve(JavaObject.java:76)
	at com.sun.tools.hat.internal.model.Snapshot.resolve(Snapshot.java:257)
	at com.sun.tools.hat.Main.main(Main.java:152)
ap615ses% java -version
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Server VM (build 1.6.0_03-b05, mixed mode)
ap615ses% 


Submitted On 08-MAR-2008
If it is fixed where can i how can i get the latest patch of Jhat



PLEASE NOTE: JDK6 is formerly known as Project Mustang