I am looking at the JVMTI API(http://docs.oracle.com/javase/6/docs/platform/jvmti/jvmti.html) in order to get the current heap at a given state.
In order to do this, I would like to use the FollowReferences (http://docs.oracle.com/javase/6/docs/platform/jvmti/jvmti.html#FollowReferences) method which takes as argument a pointer to a jvmtiHeapCallbacks structure which define several callbacks and especially a Heap Reference Callback.
This callback must be of the following form:
typedef jint (JNICALL *jvmtiHeapReferenceCallback)
(jvmtiHeapReferenceKind reference_kind,
const jvmtiHeapReferenceInfo* reference_info,
jlong class_tag,
jlong referrer_class_tag,
jlong size,
jlong* tag_ptr,
jlong* referrer_tag_ptr,
jint length,
void* user_data);
I don't understand how I can use the class_tag? In the API, I haven't be able to find a fonction converting a class_tag to a jclass. I have looked several exemples and could not get usage of the class_tag.
In the API, there is a SetTag and GetTag functions but they appear to be for jobject and not for jclass.