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

Clarify the behavior of System::gc w.r.t. reference processing

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 17
    • None
    • core-libs
    • b30

        This is a follow up to CSR JDK-8224760
        Here are few comments after reading "java.lang.ref" spec:
        https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/ref/package-summary.html

        #1 The first sentence in the package is "Provides reference-object classes, which support a limited degree of interaction with the garbage collector." Looks not perfectly correct for every GC - degree of interaction might be limited down to zero.

        #2 "Post-mortem cleanup actions can be registered and managed by a Cleaner". For some GCs there are no post-mortem cleanup actions possible as there's no post-portem. Everyone is immortal.

        #3 "A program may request to be notified of changes in an object's reachability". With some GCs it is never notified.

        #4 "Some time after the garbage collector determines that the reachability of the referent has changed to the value corresponding to the type of the reference, it will clear the reference and add it to the associated queue". Not the case with some extreme GCs - one might be never capable and never would try to determine this and update the associated queue.

              mchung Mandy Chung (Inactive)
              dbessono Dmitry Bessonov
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: