You can set a goal for JVM for maximum pause time in milliseconds for G1 GC:
-XX:MaxGCPauseMillis=xxx, where xxx means the desired amount for pause time in milliseconds for Garbage First garbage collector
JVM allows you to tune it’s behavior during garbage collection. When JVM needs to make space because a region of memory is full a pause occurs. If the rate data is stored in memory exceeds the rate at which it is removed a region can fill up. We can tune the JVM, in order to try to minimize garbage collection pause, also known as a stop-the-world event. During a pause, all other operations are suspended. It also affects networking, so the node can appear as down to other nodes in the cluster. CRUD statements will also pause, which increases read and write latencies. It is recommended to stay within 500-2000 millis range. This argument will set a target for the maximum GC pause time. This is a soft goal, and the JVM will make its best effort to achieve it.
Default is 500ms if G1 is enabled
TODO link UseG1GC, MinHeapFreeRatio, MaxHeapFreeRatio, Xmx, Xms, UseSerialGC, USeParNewGC, UseParallelGC, UseZGC
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.