RFR: 8370947: Mitigate Neoverse-N1 erratum 1542419 negative impact on GCs and JIT performance [v13]

Evgeny Astigeevich eastigeevich at openjdk.org
Wed Dec 3 19:51:32 UTC 2025


On Wed, 3 Dec 2025 18:50:44 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> The current algorithm:
>> - Create an object used in Java methods.
>> - Run the methods in the interpreter.
>> - Compile the methods.
>> - Make the object garbage collectable.
>> - Run GC (we measure this).
>> 
>> There are not many things to warm-up. And setting up everything for multiple iterations of GC runs might be expensive. Instead we use forks.
>> 
>> IMO, Yes it is `@BenchmarkMode(OneShot)`.
>
> Yeah, but first GC would likely be slower, because it would have more real work to do. So you probably want OneShot with the default number of iterations. It will warmup by doing a few GCs, and then do a few other GCs for measurement.

I have `Thread.sleep(1000)` in `setupCodeCache()` to let everything to settle down. I use it because I saw high variance in GC times. With it variance became OK.

Maybe I should use `System.gc()` instead of `Thread.sleep`.

> So you probably want OneShot with the default number of iterations.

Will I need to recreate an object and to rerun Java methods before each iteration? The first iteration will collect garbage object `fields`. So following iterations running GC will do nothing. Or will they patch nmethods again?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28328#discussion_r2586405992


More information about the hotspot-dev mailing list