Hi all, I'm doing some tuning work for Harmony running SpecJVM98. I write a JVMTI agent to catch VMDeath event and do something at the end of JVM's life, but that doesn't work(the same agent work well for hotspot).
my agent likes bellow: ... static void JNICALL callbackVMDeath(jvmtiEnv *jvmti, JNIEnv *jni) { assert(false); printf("vm death\n"); } JNIEXPORT void JNICALL Agent_OnUnload(JavaVM *jvm) { assert(false); printf("unload!"); } JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) { ... error = jvmti->SetEventNotificationMode(JVMTI_ENABLE,JVMTI_EVENT_VM_DEATH, (jthread)NULL); callbacks.VMDeath = &callbackVMDeath; error = jvmti->SetEventCallbacks(&callbacks,(jint)sizeof(callbacks)); ... } ... The program ends correctly. This is really strange. Can anyone try this case and explain for me? Thanks a lot. 2009-11-26 johnnylj98