Remix.run Logo
▲ Fizzadar 6 hours ago

I remember switching on G1GC for Elasticsearch back in 2014 and it was a total game changer for cluster stability (ES had plenty of other warts back then to counter the improvement). Cool to see it land as the default everywhere over a decade later.

▲cogman10 4 hours ago | parent | next [-]

It's definitely gotten a LOT better since it was introduced. Java 17, in particular, really made G1 great.

But if you've not already looked at it for your usages, I suggest people check out both the parallel collector and ZGC. ZGC in particular has been getting a lot of very nice features. Semi recently getting fast heap freeing (to the OS). The parallel collector for small heaps can generally beat G1 pause times.

Where G1 really shines over the parallel collector is the fact that it regularly collects old gen. If your app has a lot of caches, then G1 is very good at keeping the VM from ending up with very long pauses.

▲pjmlp 3 hours ago | parent | prev [-]

It is not everywhere, because there are other JVM implementations, with their own GC algorithms.