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

Jaroslav Bachorik jbachorik at openjdk.java.net
Mon Mar 15 15:24:12 UTC 2021


On Mon, 15 Mar 2021 12:24:02 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>> @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?

@kstefanj 
> Then the heap expands and your application get to a steady state that doesn't require any more marking cycles. 

Is there a way to get the liveness info when the heap expands? If not that would mean we had no way to figure out the new live set size and would assume, conservatively, the last known value.

As I mentioned in the PR description the live size value will be a 'best effort estimate' depending on what can each particular GC provide.

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

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



More information about the hotspot-gc-dev mailing list