Parallel GC and array object layout: way off the base and laid out in reverse?

Thomas Schatzl thomas.schatzl at
Wed Sep 4 03:56:56 PDT 2013

Hi again,

  another note about the test: I do not know what the intent of the test
it, but it looks odd.

Also the results are wrong:

> > $ java -XX:+UseParallelGC ArrayLayoutTest
> > Before the GC:
> > array is at 4120951026 (0 units off base)
> >   object is at 4120951033, 7 units off base, toString = 0

                             ^^^ the first array element is typically on
word offset 3 or so... (iirc in the simplest case: 1 word header, 1 word
klass pointer, 1 int element size and possibly some padding).

Looking at the code in more detail, addressOf() simply seems to return
the address value of the element. Which may be anywhere.

I.e. arr[i] instead of &arr[i] when using C notation.

Maybe I misunderstand the code completely though.


More information about the hotspot-gc-dev mailing list