File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,17 +11,29 @@ jmh {
1111
1212 // Force a System.gc() between iterations so heap state is reset before each
1313 // measurement starts. Without this, a GC pause can land inside the measurement
14- // window and show up as a spurious regression in CI. Safe under G1 (JDK 21
15- // default) — avoid combining with -XX:+DisableExplicitGC, which would make this
16- // a silent no-op.
14+ // window and show up as a spurious regression in CI.
1715 forceGC = true
1816
1917 // -Xbatch forces JIT compilation to run synchronously on the benchmark thread
2018 // instead of on a background compiler thread. With background compilation, the
2119 // C2 thread can kick in mid-measurement and steal CPU cycles, producing jitter
2220 // that shows up as a regression on unchanged code. Synchronous compilation
2321 // front-loads the cost into warmup where it belongs.
24- jvmArgs.set(listOf (" -Xbatch" ))
22+ //
23+ // -Xms/-Xmx: Fixed heap size eliminates resize pauses and adaptive sizing noise.
24+ // -XX:+AlwaysPreTouch: Pre-touches all heap pages at startup so lazy page faults
25+ // don't land inside measurement windows.
26+ // -XX:+UseSerialGC: Single-threaded GC is the most predictable — no concurrent
27+ // GC threads, no G1 refinement jitter.
28+ // -XX:-UseAdaptiveSizePolicy: Prevents the GC from dynamically resizing
29+ // young/old generations between runs.
30+ jvmArgs.set(listOf (
31+ " -Xbatch" ,
32+ " -Xms2g" , " -Xmx2g" ,
33+ " -XX:+AlwaysPreTouch" ,
34+ " -XX:+UseSerialGC" ,
35+ " -XX:-UseAdaptiveSizePolicy" ,
36+ ))
2537}
2638
2739sourceSets {
You can’t perform that action at this time.
0 commit comments