RFR (S) 8075030: JvmtiEnv::GetObjectSize reports incorrect java.lang.Class instance size

serguei.spitsyn at oracle.com serguei.spitsyn at oracle.com
Mon Jun 6 17:44:17 UTC 2016


On 6/6/16 09:37, Aleksey Shipilev wrote:
> So I think there is consensus this fix is okay. I am going to push it
> soon via jdk9/hs, if there are no further objections.

Yes.

Thanks,
Serguei

>
> On 06/02/2016 11:15 AM, serguei.spitsyn at oracle.com wrote:
>> Aleksey, I'm Ok with the change too.
> On 6/1/16 23:59, Staffan Larsen wrote:
>> I think the change is fine, but I also think we should add a release
>> note about the change to avoid surprises.
> On 6/1/16 10:19, Coleen Phillimore wrote:
>> This seems like a pretty straightforward fix. [...] Thanks for fixing
>> this and the tests.
> Thanks,
> -Aleksey
>
>
>>>>>>> On 5/31/16 00:40, Aleksey Shipilev wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Please review a tiny fix in GetObjectSize:
>>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8075030
>>>>>>>> http://cr.openjdk.java.net/~shade/8075030/webrev.01/
>>>>>>>> <http://cr.openjdk.java.net/%7Eshade/8075030/webrev.01/>
>>>>>>>>
>>>>>>>> I think this is a leftover from Metaspace work.
>>>>>>>>
>>>>>>>> For some reason, JvmtiEnv::GetObjectSize has a special case for
>>>>>>>> java.lang.Class: it returns the Klass* size, not the java.lang.Class
>>>>>>>> instance size. This is incorrect: Klass* is indeed referenced from
>>>>>>>> java.lang.Class.metadata field, but the instance size itself does
>>>>>>>> not
>>>>>>>> depend on metadata size. This confuses Instrumentation.getObjectSize
>>>>>>>> users.
>>>>>>>>
>>>>>>>> Testing: new test; RBT, :hotspot_compiler, :hotspot_gc,
>>>>>>>> :hotspot_runtime, :hotspot_serviceability, :hotspot_misc,
>>>>>>>> :jdk_management, :jdk_instrument, :jdk_jmx, :jdk_jdi, :svc_tools.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> -Aleksey
>



More information about the hotspot-runtime-dev mailing list