RFR: 8325403: Add SystemGC JMH benchmarks [v2]
Stefan Johansson
sjohanss at openjdk.org
Tue Feb 13 12:11:55 UTC 2024
On Tue, 13 Feb 2024 11:46:33 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
>> Stefan Johansson has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Restructure and rename
>
> test/micro/org/openjdk/bench/vm/gc/system_gc/AllDead.java line 38:
>
>> 36: import java.util.concurrent.TimeUnit;
>> 37:
>> 38: @BenchmarkMode(Mode.SingleShotTime)
>
> I had a discussion with Stefan about the usefulness of using single-shot mode (i.e. no warmup, no iterations).
> This can make algorithms (like Serial GC MSC) look better than they are as parts of the algorithm may be dependent on existing dead objects (i.e. it needs to iterate over dead objects to find marked objects). However setting up a "fair" dead object distribution isn't that easy. One could simply just assume the previous' GC's dead objects are representative "fair", but one can argue endlessly about it.
>
> Just something to consider when interpreting the results.
I agree, generating good and fair pre-conditions for these tests is not straight forward. As mentioned offline I find going with a new JVM for each run to be most fair, to generate scenarios where there are dead objects in the old generation we could have tests where the setup does a `System.gc()` to move parts of the "heap under test" to old. This could be interesting, but could potentially also lead to more variance.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17784#discussion_r1487739281
More information about the hotspot-gc-dev
mailing list