RFC (round 1), JEP draft: Low-level Object layout introspection methods
Remi Forax
forax at univ-mlv.fr
Sun Aug 23 21:13:50 UTC 2020
----- Mail original -----
> De: "Florian Weimer" <fw at deneb.enyo.de>
> À: "Aleksey Shipilev" <shade at redhat.com>
> Cc: "Brian Goetz" <brian.goetz at oracle.com>, "jdk-dev" <jdk-dev at openjdk.java.net>
> Envoyé: Dimanche 23 Août 2020 22:37:26
> Objet: Re: RFC (round 1), JEP draft: Low-level Object layout introspection methods
> * Aleksey Shipilev:
>
>> I can see that the JEP can be split in "non-controversial" (sizeOf,
>> deepSizeOf) and "controversial" (addressOf, fieldOffsetOf)
>> parts. For the process overhead reasons, I'd push forward with just
>> one JEP at the moment, though.
>
> Are there JVMs out there where naive implementation of deepSizeOf
> (with something like IdentityHashMap in the background) would itself
> change object layout and sizes?
>
> A theoretical implementation of System.identityHashCode() might
> allocate a word for the identity hash only after the method has been
> applied to the object and the object has been moved.
yes, i believe IBM OpenJ9 use/used this exact trick.
I remember reading a paper about that.
Rémi
More information about the jdk-dev
mailing list