Bug in "loss due alignment" report?

Aleksey Shipilev aleksey.shipilev at oracle.com
Tue Oct 13 11:26:48 UTC 2015


On 10/13/2015 11:27 AM, Jaromir Hamala wrote:
> perhaps one more improvement could be done:
>  OFFSET  SIZE  TYPE DESCRIPTION                    VALUE
>       0     4       (object header)                01 00 00 00 (0000
> 0001 0000 0000 0000 0000 0000 0000)
>       4     4       (object header)                00 00 00 00 (0000
> 0000 0000 0000 0000 0000 0000 0000)
>       8     4       (object header)                0a 02 fc df (0000
> 1010 0000 0010 1111 1100 1101 1111)
>      12     4   int [I.length                      N/A
>      16     8   int [I.<elements>                  N/A
> 
> 
> It would be nice to show the actual array length in the value column. 
> 
> I believe you deliberately decided not to interpret HotSpot internal
> data, but this one could be done safely. It's just a convenience thing
> anyway as the length can be calculated from size even now.

Yeah, in Hotspot, the array length is logically a part of object header.
So we can piggyback on that introspection:
  https://bugs.openjdk.java.net/browse/CODETOOLS-7901531

Thanks,
-Aleksey




More information about the jol-dev mailing list