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

Stefan Johansson sjohanss at openjdk.java.net
Mon Mar 15 12:27:17 UTC 2021


On Mon, 15 Mar 2021 09:26:32 GMT, Jaroslav Bachorik <jbachorik at openjdk.org> wrote:

>> Started reviewing PR #2760, and it implements liveness calculation for G1 full gc. I also suggested [there](https://github.com/openjdk/jdk/pull/2760#discussion_r592449837) to extract this functionality out into an extra CR. Maybe you can work together.
>
> @tschatzl @Hamlin-Li 
> Would it be ok to set the live estimate to the `used()` value at the end of `G1FullCollector::phase4_do_compaction()` method to have something suboptimal but working and refine in https://github.com/openjdk/jdk/pull/2760 (or a subsequent ticket/PR once both parts are ready)?

Sorry for being a bit late to the party. Looking at the suggested implementation for G1 I see a problem with only updating this after concurrent mark (and the Full GC). Say for example you have a concurrent mark cycle before the heap has expanded a lot and you get a low value stored in `G1CollectedHeap::_live`. Then the heap expands and your application get to a steady state that doesn't require any more marking cycles. In this case the same value will be reported for the entire run.

For this to work the _live value would have to be updated at every GC, but this is a bit costly. Maybe the first version could just use `used()` for G1. Have you done any tests to see how off this would be compared to the other GCs?

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

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



More information about the hotspot-gc-dev mailing list