You can choose 1 of the 5 available garbage collectors, one of them is ParallelGC:
The default GC that is used by JVM. It is similar to Serial GC, but in contrast to it, it uses multiple threads for garbage collection and maintaining heap, but it still freezes other threads while performing GC. Parallel GC can use multiple CPUs to speed up the application throughput. So, it is also known as throughput collector. It is used if we want to execute a long process (like batch processing) and where long pauses are acceptable. If we use this GC, we can specify maximum garbage collection threads and pause time, throughput, and footprint (heap size) with -XX:ParallelGCThreads=<N>, -XX:MaxGCPauseMillis=<N>.
Default is Parallel GC.
TODO link ParallelGCThreads, MaxGCPauseMillis , GCTimeRatio, MinHeapFreeRatio, MaxHeapFreeRatio, Xmx, Xms, UseSerialGC, USeParNewGC, 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.