--- old/src/hotspot/share/prims/jvmtiEnv.cpp 2018-10-11 11:58:42.851075413 +0200 +++ new/src/hotspot/share/prims/jvmtiEnv.cpp 2018-10-11 11:58:42.698076781 +0200 @@ -470,7 +470,8 @@ JvmtiEnv::GetObjectSize(jobject object, jlong* size_ptr) { oop mirror = JNIHandles::resolve_external_guard(object); NULL_CHECK(mirror, JVMTI_ERROR_INVALID_OBJECT); - *size_ptr = (jlong)Universe::heap()->obj_size(mirror) * wordSize; + size_t obj_size = mirror->size(); + *size_ptr = (jlong)Universe::heap()->cell_size(obj_size) * wordSize; return JVMTI_ERROR_NONE; } /* end GetObjectSize */