Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Looking at that, why isn't ZGC the standard GC in Java 17?


One of the graphs shows ZGC with almost 50% more overhead (in heap space) than G1, which could very well take some applications from "works fine" to "broken." So I can see why they'd leave it something to opt in to.


Latency and throughput are fundamentally opposite ends of the same axis. And perhaps the majority of Java applications prefer better throughput.


But the graph in the article shows that ZGC now gets better throughput than G1! [EDIT no it doesn't]

I suspect the answer is that ZGC is not considered mature enough, and has a higher memory overhead than G1.


No, that graph may be hard to understand. It shows the relative improvement each GC has made since Java 8, not the absolute performance.


Ah, i realised it was relative, but i had assumed they were all relative to the same baseline! Should have been obvious from the way the bars are all level for JDK 8, really. That seems a needlessly unhelpful graph.


They are essentially 3 graphs displayed together. It probably would have make sense to present them more separately.


The article does not compare the throughput of different GCs other than different improvements. The baseline for the G1 graph is JDK8 G1 performance and the baseline for the ZGC graph is JDK11 ZGC performance. There is really nothing that can be directly compared between the two.


There are also other GCs that are heavily competitive with ZGC, such as Shenandoah. It might make sense to see how they all pan out before choosing a new default.


Shenandoah isn't an Oracle maintained feature, so they'll never allow it to become the OpenJDK default (though another vendor make it so in their distribution).


G1 is probably still a better choice as it "balances throughput and latency". ZGC also wasn't generational until recently.


I see that generational ZGC is under development, but have you been able to try it out? I don't see any EA releases for it.


I have not tried it. I just saw the commits (it was 5 months ago), so I had assumed it was merged.


Probably once ZGC gets the generation support (https://github.com/openjdk/zgc/tree/zgc_generational) which will reduce the memory footprint.


Absolute gc throughput and overhead.


Only stabilized in Java 15




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: