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

JVMTI Spec: Agent_OnUnload needs clarifications

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 6
    • hotspot
    • b92
    • generic
    • generic
    • Verified

      The JVM TI specification (1.1.95) at:
       http://download.java.net/jdk6/doc/platform/jvmti/jvmti.html
      states as follows about native agent's shutdown (unloading) from VM:
        --- Excerpt-from-spec ---
        ...
        JNIEXPORT void JNICALL
        Agent_OnUnload(JavaVM *vm)

        This function will be called by the VM when the library is about to be unloaded.
        The library will be unloaded and this function will be called if some platform
        specific mechanism causes the unload (an unload mechanism is not specified in this
        document) or the library is (in effect) unloaded by the termination of the VM
        whether through normal termination or VM failure, including start-up failure.
        ...
        This function can be used to clean-up resources allocated during Agent_OnLoad.
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        ...
        --- End-of-excerpt-from-spec ---

      That final statement (that is can be used to clean-up resources) should really
      say "Agent_OnLoad or Agent_OnAttach" because it's unclear from the spec
      when and how an agent which is loaded in Live Phase will be unloaded from VM.

            rfield Robert Field (Inactive)
            ygaevsky Yuri Gaevsky (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: