Usage:
You can choose 1 of the 5 available garbage collectors, one of them is ZGC:
-XX:+UseZGC
Description:
ZGC is a scalable and low-latency GC. It is fully available starting Java 15. ZGC performs all expensive operations concurrently, not stopping the execution of application threads for more than 10 ms, which is good for a low-latency apps. It is recommended for server applications, where large heaps are common, and fast application response times are a requirement. One very important tuning option for ZGC is setting the correct max heap size (-Xmx). ZGC is a concurrent collector, thus a max heap size must be selected such that, 1) the heap can accommodate the live-set of your application, and 2) there is enough headroom in the heap to allow allocations to be serviced while the GC is running. The amount of headroom that is needed very much depends on the allocation rate and the live-set size of the application. In general, the more memory you give to ZGC the better.
Default Value:
Default is Parallel GC.
Errors:
None
Arguments related:
TODO link ParallelGCThreads, MaxGCPauseMillis , GCTimeRatio, MinHeapFreeRatio, MaxHeapFreeRatio, Xmx, Xms, UseSerialGC, USeParNewGC, UseG1GC, UseZGC
Related Posts:
NOTE:
If you have additional comments, interesting experiences or even point of disagreement with this JVM argument description, please leave a comment. Your insights will help the entire 10+ million java developer community to develop one standard source of documentation for all the JVM arguments.
Edit your Comment