RFR: 8295269: G1: Improve slow startup due to predictor initialization
Thomas Schatzl
tschatzl at openjdk.org
Fri Oct 18 08:05:30 UTC 2024
Hi all,
please review this change that improves 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 garbage collections heavily impact heap expansion, potentially expanding the heap much less, resulting in less throughput. I.e. we do more GCs during startup, causing higher cpu time ratio, expanding more.
The changes are still well within allowed range wrt to cpu time ratio etc.
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
-------------
Commit messages:
- * remove debug code
- * workaround for unproductive concurrent cycles
- * boost prediction initialization
Changes: https://git.openjdk.org/jdk/pull/21518/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21518&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8295269
Stats: 7 lines in 2 files changed: 6 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/21518.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/21518/head:pull/21518
PR: https://git.openjdk.org/jdk/pull/21518
More information about the hotspot-gc-dev
mailing list