1

I am using Java 11 and the new Z garbage collector(ZGC) seems really promising.

Docs say that it uses some low-latency garbage collection mechanism such that GC pause times never exceeds 10 ms, handles large heaps extremely well and allows to return unused heap memory to OS which wasn't there with the old GC's

My concern is - How stable is ZGC and are there risks if one goes forward with it in prod?

Thanks!

Naman
  • 27,789
  • 26
  • 218
  • 353
Amit kumar
  • 2,169
  • 10
  • 25
  • 36
  • 1
    A useful question indeed, but off-topic for this community possibly. – Naman Jun 20 '20 at 01:17
  • 2
    The only possible answers that people (apart from Oracle) can give will be based on anecdotal evidence. Not scientific. Not necessarily believable. Therefore we can't you give an answer that isn't highly opinion based. – Stephen C Jun 20 '20 at 03:14
  • 2
    1) The stability is not quantifiable. 2) Of course there are risks, but they are not quantifiable either. My advice would be make your decision based on the cost / benefit of going into prod now >>assuming<< that there is a high risk of failure; i.e. decide if it is advisable to *gamble* on a good outcome, even though you don't know the odds. – Stephen C Jun 20 '20 at 03:19

2 Answers2

5

According to the JEP 377 page (the 2020/05/25 update):

Since its introduction in JDK 11 we’ve received positive feedback, we’ve ironed out many bugs, and we’ve added a number of features and enhancements. To highlight some of the more important ones:

  • Concurrent class unloading
  • Uncommitting unused memory (JEP 351)
  • Maximum heap size increased from 4TB to 16TB
  • Minimum heap size decreased to 8MB
  • -XX:SoftMaxHeapSize
  • Support for the JFR leak profiler
  • Support for class-data sharing
  • Limited and discontiguous address spaces
  • Support for placing the heap on NVRAM
  • Improved NUMA awareness
  • Multi-threaded heap pre-touching

Furthermore, all commonly used platforms are now supported:

  • Linux/x86_64 (JEP 333)
  • Linux/aarch64 (8214527)
  • Windows (JEP 365)
  • macOS (JEP 364)

Testing of ZGC suggests that it is stable and, as of this writing, we have received no new ZGC-specific bugs for a few months. With the stability, feature set, and platform support that ZGC has today, it is time to remove its experimental status and make it a product feature.

A couple of caveats:

  • This comes from the team working on the ZGC project. There is a possibility that they are not being entirely objective. (That is just human nature ...).
  • It depends on how many people (the team and users) are testing / trying out the new GC.
  • It depends on what they are testing / trying out, and whether that is a good match for what you are proposing to do.
  • With something as complex as a new Java GC it could take years for some bugs to surface in a reproducible form.

So, while promising, this does NOT count as a quantifiable measure of stability, and does not give a quantifiable measure of risk.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
4

ZGC is still an experimental feature. Making it a product feature is planned for JDK 15.

ZhekaKozlov
  • 36,558
  • 20
  • 126
  • 155