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

Aleksey Shipilev aleksey.shipilev at oracle.com
Tue May 31 07:40:50 UTC 2016


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/

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20160531/07c4ae0f/signature.asc>


More information about the serviceability-dev mailing list