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

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • tbd
    • 16
    • hotspot
    • 16

      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).

            Unassigned Unassigned
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: