Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4494358

Future EnableEvent of OBJECT_ALLOC event is ignored once it's disabled

XMLWordPrintable

    • 03
    • x86
    • windows_nt
    • Not verified

        OS: Win2K
        JDK: 1.3.1

        Enable JVMPI_EVENT_OBJECT_ALLOC, and disable it, and enable it again. Then this
        event is not sent. But classc VM is OK. This poroblem is only HotSpot VM problem.

        I implement the fix for bugid:4449231, but couldn't get the improvement.

        ------------------------------------------------------------------
        #include "jvmpi.h"

        JVMPI_Interface *jvmpi_interface;
        #define CALL(f) (jvmpi_interface->f)

        static void notify_event(JVMPI_Event *event)
        {
        switch(event->event_type) {
        case JVMPI_EVENT_OBJECT_ALLOC:
        print("object_alloc\n");
        break;
        default:
        break;
        }
        }

        JNIEXPORT jint JNICALL JVM_OnLoad(JavaVM *jvm, char *options, void *erserved)
        {
        if((*jvm)->GetEnv(jvm, (void **)&jvmpi_interface, JVMPI_VERSION_1) < 0)
        return JNI_ERR;

        jvmpi_interface->NotifyEvent = notify_event;

        CALL(EnableEvent)(JVMPI_EVENT_OBJECT_ALLOC, NULL);
        CALL(DisableEvent)(JVMPI_EVENT_OBJECT_ALLOC, NULL);
        CALL(EnableEvent)(JVMPI_EVENT_OBJECT_ALLOC, NULL);

        return JNI_OK;
        }
        --------------------------------------------------------------------

              mchung Mandy Chung
              mkamito Masaaki Kamito (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: