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

Re-instate idle monitor deflation as part of System.gc()

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: hotspot
    • Subcomponent:
    • Introduced In Version:
      16

      Description

      All in-use monitors maintain a strong reference to their associated object and so will keep it live, even if the monitor reference is the only reference to that object. With asynchronous monitor deflation this can cause a surprise when code uses System.gc() to reclaim memory, but because monitors have not yet been deflated the memory is not actually reclaimed. Prior to JDK-8246477 there was a special hook in JVM_GC to trigger safepoint based deflation before the actual GC. That safepoint-based mechanism has been removed but was replaced with ObjectSynchronizer::request_deflate_idle_monitors(). We should call that in JVM_GC, and in all equivalent APIs (e.g. WhiteBox WB_FullGC).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dcubed Daniel Daugherty
                Reporter:
                dholmes David Holmes
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: