Re: [8u] RFR backport of JDK-8144732: VM_HeapDumper hits assert with bad dump_len

Denghui Dong denghui.ddh at alibaba-inc.com
Sat Oct 5 02:26:56 UTC 2019


Any comments ?

Thanks,
Denghui Dong
------------------------------------------------------------------
From:董登辉(卓昂) <denghui.ddh at alibaba-inc.com>
Send Time:2019年9月25日(星期三) 16:02
To:jdk8u-dev <jdk8u-dev at openjdk.java.net>
Subject:Re: [8u] RFR backport of JDK-8144732: VM_HeapDumper hits assert with bad dump_len


A correction:
Original bug: https://bugs.openjdk.java.net/browse/JDK-8144732

Thanks
Denghui Dong
------------------------------------------------------------------
From:董登辉(卓昂) <denghui.ddh at alibaba-inc.com>
Send Time:2019年9月25日(星期三) 14:25
To:jdk8u-dev <jdk8u-dev at openjdk.java.net>
Subject:[8u] RFR backport of JDK-8144732: VM_HeapDumper hits assert with bad dump_len

Hi all, 
  I'd like to request a backport of JDK-8144732.

  In our production environment, many application use large heap, and there are some
big arrays in the heap. When developers use jmap to dump heap, and use Eclipse MAT(mostly) 
or jhat to analyze the file, often got error. For example:

public class BigArray {
  public static void main(String[] args) throws Exception {
    long[] b = new long[1024 * 1024 * 1024 / 2];
    Object o = new Object();
    synchronized(o) {
      o.wait(60000);
    }
  }
}

  If you run the above code, and use jmap to generate a dump file, then use jhat to parse it,
you will got a warning message:

"WARNING: Error reading heap dump or heap dump segment:  Byte count is -4294967296 instead of 0"

  Eclipse MAT also can't parse the dump file correctly.

  The root cause is the length of the segment exceeds the limit.

  I found that JDK-8144732 can resolve this problem, because it can truncate the array whose
size is too large and ensure a segment length within limit.

The patch (from JDK9) doesn't apply cleanly.

Original bug: https://bugs.openjdk.java.net/browse/JDK-8150432

Original patch: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/91a26000bfb5

My webrev: http://cr.openjdk.java.net/~luchsh/8144732_8u/

Testing:
  jdk/test/demo/jvmti/hprof/HeapDumpTest.java passed.
  jdk/test/sun/tools/jhat/HatHeapDump1Test.java passed.

  What's your comments ?

Thanks
Denghui Dong


More information about the jdk8u-dev mailing list