[EXTERNAL] Re: RFC: G1 as default collector (for real this time)

Thomas Schatzl thomas.schatzl at oracle.com
Fri Mar 21 08:30:11 UTC 2025


Hi Monica,

   thanks for posting about your observation!

On 18.03.25 00:59, Monica Beckwith wrote:
> Hi Thomas, Erik, and all,
> 
> This is an important and timely discussion, and I appreciate the 
> insights on how the gap between SerialGC and G1GC has diminished over 
> time. Based on recent comparative tests of out-of-the-box GC 
> configurations (-Xmx only), I wanted to share some data-backed 
> observations that might help validate this shift.
> 
> I tested G1GC and SerialGC under 1-core/2GB and 2-core/2GB containerized 
> environments (512MB < -Xmx <1.5GB), running SPECJBB2015 with and without 
> stress tests. The key findings:
> 
> *Throughput (max_jOPS & critical_jOPS):*
> 
>   *
>     G1GC consistently outperforms SerialGC.
>   *
>     1 core: G1GC shows a 1.78× increase in max_jOPS.
>   *
>     2 cores: G1GC shows a 2.84× improvement over SerialGC.
> >
> *Latency and Stop-the-World (STW) Impact:*
> 
>   *
>     SerialGC struggles under stress, with frequent full GCs leading to
>     long pauses.
>   *
>     G1GC’s incremental collections keep pause times lower, especially
>     under stress load.
>   *
>     critical_jOPS, a key SLA metric, is 4.5× higher for G1GC on 2 cores.
> 
> 
> *Memory Behavior & Stability:*
> 
>   *
>     In 512MB heap configurations, SerialGC encountered OOM failures due
>     to heap exhaustion.
> 
> 
> Given these results, it seems reasonable to reconsider why SerialGC 
> remains the default in small environments when G1GC offers clear 
> performance and stability advantages.
> 
> Looking forward to thoughts on this.

   this is somewhat what we have noticed too: Serial (and maybe to some 
more extent Parallel) are good as long as there are no full gcs; if 
there are, G1 fairly quickly becomes competitive, even more so with 
increasing full gc frequency, at some point overtaking it.

Serial could certainly be better with some manual generation size 
tuning, but the suggestion is about the default collector choice. Imo 
that one should largely be about default settings.

The situation is becoming even more in favor of G1 with the new 
"throughput" barriers (JDK-8342382).

Thomas


More information about the hotspot-gc-dev mailing list