RFR: 8295269: G1: Improve slow startup due to predictor initialization
Stefan Johansson
sjohanss at openjdk.org
Tue Oct 22 09:49:25 UTC 2024
On Tue, 15 Oct 2024 09:53:05 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
> Hi all,
>
> please review this change that decreases the time it takes to adapt the predictors to actual values during startup.
>
> Currently predictors are initialized using compiled-in values. These values are extremely conservative as they have been based on some SPARC test runs on specjbb2000(?) or so, which means that it takes a while until the weights from these values are "gone" from the predictor sequences. (This can take 20-30 GCs).
>
> The change modifies prediction so that only the first prediction will use these pre-baked values, after that use live values.
>
> This makes G1 adapt much more quickly to the current application/environment.
>
> The drawback is that there may be differences (including regressions) in out-of-box performance because the initial garbage collections heavily impact heap expansion, potentially expanding the heap much less, resulting in less throughput. I.e. in the old policy we may do many more GCs during startup, causing higher cpu time ratio at that time, expanding more (than necessary).
>
> GC cpu usage with the new policy is still well within allowed range wrt to cpu time ratio.
>
> This also does not impact reasonable test setups.
>
> Testing: gha, internal performance benchmarks mostly show no change or improvements. There are some regressions that are "fixed" by setting min/max heap size indicating this is a heap sizing difference caused by differences due to faster startup.
>
> Hth,
> Thomas
Looks good.
-------------
Marked as reviewed by sjohanss (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/21518#pullrequestreview-2384620734
More information about the hotspot-gc-dev
mailing list