RFR: 8314629: Generational ZGC: Clearing All SoftReferences log line lacks GCId

Erik Österlund eosterlund at openjdk.org
Thu Dec 28 10:29:40 UTC 2023


On Thu, 28 Dec 2023 05:56:56 GMT, Guoxiong Li <gli at openjdk.org> wrote:

> Hi all,
> 
> This patch adds the GCId to the log of soft reference policy. I move the related code to the start of the old generational GC which needs  to add a parameter `ZDriverRequest` in the method `ZDriverMajor::collect_old`. An alternative, which doesn't need to add a parameter, is only moving the related code to the start of the major GC, concretely the method `ZDriverMajor::gc`. But considering the references only be cleared in old generational GC, I make such decision. Waiting for your opinion on it.
> 
> Thanks for taking the time to review.
> 
> Best Regards,
> -- Guoxiong

This makes me a bit nervous. I think this introduces behavioural changes and not just logging changes. By moving the decision making of whether to clear soft references or not past the mark start pause that bumps the sequence number of the two generations, I think you are subtly introducing a race condition that can yield premature OOM issues. If you want to change the logging here, I think we need to find a different way. Perhaps decouple the decision making and logging so we can log wherever we want to without changing the behaviour.

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

Changes requested by eosterlund (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/17196#pullrequestreview-1797910174


More information about the hotspot-gc-dev mailing list