You can choose 1 of the 5 available garbage collectors, one of them is CMS GC:
The Concurrent Mark Sweep (CMS) GC uses multiple threads for it’s regular garbage collection routine. It's designed for applications that prefer shorter garbage collection pauses, and can afford to share processor resources with the garbage collector while the application is running. It was designed for server-style apps running on multiprocessor servers with big amount of memory. Simply put, applications using this type of GC respond slower on average, but don't stop responding to perform garbage collection. Removed from java 14, not available in java 15.
Default is Parallel GC.
TODO link ParallelGCThreads, MaxGCPauseMillis , GCTimeRatio, MinHeapFreeRatio, MaxHeapFreeRatio, Xmx, Xms, UseSerialGC, UseParallelGC, UseG1GC, 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.