[concurrency-interest] @Contended (JEP-142)

Vitaly Davidovich vitalyd at gmail.com
Fri Nov 30 09:50:59 EST 2012


Hmm, that doesn't seem right to me.  Compressed oops should only change the
pointer size of the fields themselves, it shouldn't cause header size to be
reported differently.  So pointers after header become 4 bytes instead of
8, but header should be consistently 16.  I understand that this is an
estimate via unsafe, but seems off.

Thanks

Sent from my phone
On Nov 30, 2012 9:44 AM, "Aleksey Shipilev" <aleksey.shipilev at oracle.com>
wrote:

> On 11/30/2012 06:32 PM, Vitaly Davidovich wrote:
> > Why is header reported as 12 bytes? Should that not be two words (16
> > bytes on x64)?
>
> This starts to get off-topic.
>
> This is the estimate of the first field's offset, might be not the
> header itself. CompressedOops allow me to do this, see:
>
> $ java -XX:-UseCompressedOops
> Test8003985.Test2
>    (header 16 bytes)
>   16   4             int Test2.int2
>    (gap 128 bytes)
>  148   4             int Test2.int1
> Instrumentation reports 280 bytes per instance
>
> $ java -XX:+UseCompressedOops
> Test8003985.Test2
>    (header 12 bytes)
>   12   4             int Test2.int2
>    (gap 128 bytes)
>  144   4             int Test2.int1
> Instrumentation reports 280 bytes per instance
>
> The impact of that 4 bytes is eaten up by alignment to 8 anyway.
>
> -Aleksey.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20121130/455b87df/attachment.html>


More information about the Concurrency-interest mailing list