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

GC should decide if it should clear soft references by itself

XMLWordPrintable

    • gc

      During the review of JDK-8309403 [1], we found the Parallel GC doesn't decide if it should clear soft references according to gc overhead limit and other relevant metrics.

      The ZGC has a comfortable implementation in `zDriver.cpp::should_clear_soft_references`. It is good to implement the related feature in other GCs.


      Extract from the PR [1] of JDK-8309403:

      ```
      I am not sure that using SoftRefGenPolicy is the cleanest way to solve the issue in Parallel. Can we check gc-overhead (and other relevant metrics) at gc-pause-start to decide soft-ref-policy, instead of relying on the global bool? (IOW, can GC make the more active decidion, in contrast to letting others tell GC what to do regarding to soft-refs?)

      The approach in should_clear_soft_references of zDriver seems less intrusive to the global env.
      ```

      [1] https://github.com/openjdk/jdk/pull/14296#discussion_r1221624327

            Unassigned Unassigned
            gli Guoxiong Li
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: