RFR: 8144732: VM_HeapDumper hits assert with bad dump_len
Andreas Eriksson
andreas.eriksson at oracle.com
Mon Feb 1 16:20:07 UTC 2016
Hi,
Please review this fix for dumping of long arrays.
Bug:
8144732: VM_HeapDumper hits assert with bad dump_len
https://bugs.openjdk.java.net/browse/JDK-8144732
Webrev:
http://cr.openjdk.java.net/~aeriksso/8144732/webrev.00/
Problem:
The hprof format uses an u4 as a record length field, but arrays can be
longer than that (counted in bytes).
Fix:
Truncate the dump length of the array using a new function,
calculate_array_max_length. For a given array it returns the number of
elements we can dump. That length is then used to truncate arrays that
are too long.
Whenever an array is truncated a warning is printed:
Java HotSpot(TM) 64-Bit Server VM warning: cannot dump array of type
object[] with length 1,073,741,823; truncating to length 536,870,908
Much of the change is moving functions needed by
calculate_array_max_length to the DumpWriter or DumperSupport class so
that they can be accessed.
Regards,
Andreas
More information about the serviceability-dev
mailing list