RFR: 8335493: ClearedAllSoftRefs::~ClearedAllSoftRefs should reset SoftRefPolicy::_should_clear_all_soft_refs
Liang Mao
lmao at openjdk.org
Tue Jul 2 10:03:19 UTC 2024
On Tue, 2 Jul 2024 09:14:27 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
> > set_should_clear_all_soft_refs will be set to true adaptively but never reset to false.
>
> I see; does it make sense to reset to false inside `check_gc_overhead_limit` so that callers of `set_should_clear_all_soft_refs` are in the same scope? (Other callers of `set_should_clear_all_soft_refs` always invokes it in pairs.)
>
> If this reset-to-false occurs in the destructor as in your PR, who sets it to true for Parallel or other GCs?
I guess the GC cannot be guranteed to happen because of GC Locker for Parallel GC so resetting in ~ClearedAllSoftRefs might be better. As you mentioned, check_gc_overhead_limit sets it for Parallel GC. Shenandoah explicitly sets true/false since it doesn't have the gc lock blocking issue.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19982#issuecomment-2202612595
More information about the hotspot-gc-dev
mailing list