RFR: 8308009: Generational ZGC: OOM before clearing all SoftReferences
Erik Österlund
eosterlund at openjdk.org
Thu May 25 09:00:57 UTC 2023
On Wed, 24 May 2023 12:47:56 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:
> I think it looks good.
>
> Only one thing I can think of. There is an implicit assumption here that should_clear_soft_references implies should_preclean_young which is required to be spec compliant. Maybe `should_preclean_young` should start with
>
> ```c++
> if (should_clear_soft_references(cause)) {
> return true;
> }
> ```
>
> to make this clearer. Or even short circuit the `if (should_preclean_young(...))` directly in `ZDriverMajor::collect_young`
Right. This is already guaranteed because
1) All the causes that trigger soft ref clearing GC, also trigger young precleaning
2) We hold the driver locker between the should_clear_soft_references and should_preclean_young, which means that if soft ref clearing was triggered due to there being a stall, the stall will be there again when we check if we should_preclean_young.
Do we want a comment explaining the above, or change the code structure to be more explicit? I personally don't mind.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14122#issuecomment-1562538005
More information about the hotspot-gc-dev
mailing list