RFR: 8335493: ClearedAllSoftRefs::~ClearedAllSoftRefs should reset SoftRefPolicy::_should_clear_all_soft_refs

Albert Mingkun Yang ayang at openjdk.org
Wed Jul 3 10:57:18 UTC 2024


On Tue, 2 Jul 2024 06:57:41 GMT, Liang Mao <lmao at openjdk.org> wrote:

> It's for fixing the issue should_clear_all_soft_refs is not reset after Parallel Full GC.
> 
> Tested test/hotspot/jtreg/gc with -XX:+UseParallelGC

Personally, I believe ClearedAllSoftRefs will not be necessary in the long run, as it is only used by the full GC of Parallel and G1.

To address the missing `set_should_clear_all_soft_refs(false)` in Parallel, a quick fix might be to modify the code around `check_gc_overhead_limit` so that both setters (true and false) are visible within the same scope. However, a more comprehensive improvement, in my opinion, would be to enhance the GC overhead checking in Parallel. This could be done by invoking the check at the beginning of the GC pause. This way, the decision to clear soft references can be made at the start of the GC pause and applied to the *current* GC pause, instead of deferring it to future GCs. While I believe this approach is viable, it would require further performance testing to confirm its effectiveness once a prototype is ready.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/19982#issuecomment-2205787046


More information about the hotspot-gc-dev mailing list