Currently, the class `SoftRefPolicy` has a method `should_clear_all_soft_refs` and the ZGC has a similar method `should_clear_soft_references` in `zDriver.cpp` and `xDriver.cpp`.
And the `ZCollectedHeap` and `XCollectedHeap` have a field `SoftRefPolicy _soft_ref_policy` which is never used. So I think it is good to move the method `should_clear_soft_references` of `zDriver.cpp` and `xDriver.cpp` into the subclasses of `SoftRefPolicy` (maybe also rename the related methods). It can avoid the misunderstanding of the related names and reuse the existing `SoftRefPolicy`.
And the `ZCollectedHeap` and `XCollectedHeap` have a field `SoftRefPolicy _soft_ref_policy` which is never used. So I think it is good to move the method `should_clear_soft_references` of `zDriver.cpp` and `xDriver.cpp` into the subclasses of `SoftRefPolicy` (maybe also rename the related methods). It can avoid the misunderstanding of the related names and reuse the existing `SoftRefPolicy`.
- relates to
-
JDK-8309616 GC should decide if it should clear soft references by itself
- Open
-
JDK-8325081 Move '_soft_ref_policy' to 'CollectedHeap'
- Resolved