RFR: 8258431: Provide a JFR event with live set size estimate [v12]

Jaroslav Bachorik jbachorik at openjdk.java.net
Tue Mar 16 11:09:09 UTC 2021


On Tue, 16 Mar 2021 10:47:22 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

> Sure, but for the event to be useful we want the reported value to be as close to the reality as possible. I don't understand why you want the lower bound, can you explain why? I would go for the upper bound, which in that case would be used() at the end of the GC. I know used() is not perfect, but for G1 this is the best "cheap" value we have for liveness at the end of any GC.

Mostly because `used()` will report all live instances and potential garbage and will make it inconsistent with what the other GCs would report. 

> So as a middle road I would suggest to update G1CollectedHeap::gc_epilogue(bool full) to include:
>
> set_live(used());
With this you don't need the changes for the G1FullCollector. The liveness calculated at Remark would be used until the next young collection and I think here is where some improvements could be made. During the mixed phase a better solution would make use of the liveness information we have for the old regions together with what is newly allocated, but this needs further investigation.

This sounds interesting. Let me try this out.

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

PR: https://git.openjdk.java.net/jdk/pull/2579



More information about the hotspot-gc-dev mailing list