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

JVMTI Doc: Clarify OBJECT_FREE event timing with regards to ForceGarbageCollecti

XMLWordPrintable

    • b56
    • generic
    • generic

      Clarify OBJECT_FREE event timing with regards to ForceGarbageCollection()

      From Kelly:

      It says in the JVMTI spec for ForceGarbageCollection():
       "Force the VM to perform a garbage collection.
        The garbage collection is as complete as possible.
        This function does not cause finalizers to be run.
        This function does not return until the garbage collection is finished."

      And for OBJECT_FREE it says:
       "An Object Free event is sent when the garbage collector frees an object."

      I'd read the above as meaning that most OBJECT_FREE calls WOULD be made and
      the only issue is the timing of the thread running the ForceGarbageCollection
      call, and the thread (or threads) making the OBJECT_FREE event callbacks?????

      From Alan:
        I agree the wording could be better. The ObjectFree is posted after the GC frees an object
        and the spec should say something to indicate that there isn't a guarantee that the
        ObjectFree events will be posted by the time that ForceGarbageCollection completes.
        Also, for tagged objects that have finalizers it could be sometime later before the event is posted.

            rfield Robert Field (Inactive)
            ohair Kelly Ohair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: