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

Monica Beckwith Monica.Beckwith at microsoft.com
Mon Mar 17 23:59:43 UTC 2025


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.

Best,
Monica

P.S.: I haven’t tested for <512MB heaps yet, as that requires a different test config I’m still working on. I’d also love to hear from anyone running single-threaded, CPU-bound workloads if they have observations to share.


________________________________
From: hotspot-gc-dev <hotspot-gc-dev-retn at openjdk.org> on behalf of Thomas Schatzl <thomas.schatzl at oracle.com>
Sent: Monday, February 24, 2025 2:33 AM
To: Erik Osterlund <erik.osterlund at oracle.com>
Cc: hotspot-gc-dev at openjdk.org <hotspot-gc-dev at openjdk.org>
Subject: [EXTERNAL] Re: RFC: G1 as default collector (for real this time)

Hi,

On 21.02.25 15:02, Erik Osterlund wrote:
> Hi Thomas,
>
[...]> There is however a flip side for that argument on the other side
of the scaling spectrum, where ZGC is probably a better fit on the even
larger scale. So while it’s true that the effect of a Serial -> G1
default change is a static default GC, I just think we should mind the
fact that there is more uncertainty on the larger end of the scale. I’m
not proposing any changes, just saying that maybe we should be careful
about stressing the importance of having a static default GC, if we
don’t know if that is the better strategy on the larger end of the scale
or not, going forward.

+1

Thomas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20250317/ca46da32/attachment.htm>


More information about the hotspot-gc-dev mailing list