RFR: 8335493: check_gc_overhead_limit should reset SoftRefPolicy::_should_clear_all_soft_refs

Liang Mao lmao at openjdk.org
Thu Jul 4 05:31:29 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.

I have made the reset in `check_gc_overhead_limit`.

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

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


More information about the hotspot-gc-dev mailing list