Trying to understand ZGC

stefan.reich.maker.of.eye at stefan.reich.maker.of.eye at
Tue Nov 13 04:53:51 UTC 2018

Hello there, thank you for your lovely garbage collector. I'm currently trying it for desktop use on Linux with JDK 11. (You can try my Java guest OS at

Some things are unclear to me.

-The process's resident size seems quite large. I specify -Xmx768 and get a resident size of up to 2.5 GB. The machine does not slow down though which is really weird as it only has 3.5 GB in total. Maybe the RSS value is misleading?

When turning on GC notifications, I see (sometimes):

  GC cause:  Allocation Rate (360 ms)
  Collector: ZGC
  Changes:   ZHeap: -16383 K, CodeHeap 'profiled nmethods': 85 K, Metaspace: 1 K

and more often:

 GC cause:  Proactive (147 ms)
  Collector: ZGC
  Changes:   ZHeap: -180223 K, CodeHeap 'profiled nmethods': 1 K, CodeHeap 'non-profiled nmethods': 1 K, Metaspace: 1 K, CodeHeap 'non-nmethods': 12 K

Does this mean stop-the-world GC pauses are occurring, or is my application not paused?

I have already upped GC concurrency to 4.

Generally, everything seems completely fluent, I'm noticing no actual problems apart from the weird stats as outlined above.

Full command line for good measure:

/home/stefan/dev/jdk-11.0.1/bin/java --illegal-access=permit -Xmx768m -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:ConcGCThreads=4 -XX:MaxHeapFreeRatio=20 -XX:MinHeapFreeRatio=10 -XX:+UseStringDeduplication --add-opens java.base/jdk.internal.loader=ALL-UNNAMED -jar /home/stefan/.javax/x30.jar 1016478

Many greetings,

More information about the zgc-dev mailing list