determine Java class size from JNI jclass
问题 I'm using JNI to analyze some program. I just wonder, after get jclass reference, how it is possible to find the size of the underlying class ? for example: class cls = env->FindClass("Lee/Boehm/Test"); from here how can i evaluate the size of the class Lee.Boehm.Test inside hotspot's heap ? Thank you Boehm 回答1: Here you go agent.c #include <stdlib.h> #include "jvmti.h" jvmtiEnv *globalJVMTIInterface; JNIEXPORT jlong JNICALL Java_util_Util_getObjectSize (JNIEnv *jni_env , jclass class ,