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

Serial: Remove use of should_clear_all_soft_refs in serial folder

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 23
    • 23
    • hotspot
    • gc
    • b25

      Serial already use `SerialHeap::must_clear_all_soft_refs` to clear soft-refs for WhiteBox full-gc, so there is no need for the "global" `should_clear_all_soft_refs` in the case of Serial.

      Currently, `should_clear_all_soft_refs` is used only in asserts, which are actually too strong due to racy VM-operations:

      T1: clear-soft = true ; whitebox-full-gc; clear-soft = false
      T2: invoke System.gc()

      The second thread can see inconsistency between the local variable and the global `should_clear_all_soft_refs`.

            ayang Albert Yang
            ayang Albert Yang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: