Java Cup
Inside Java

News and views from members of the Java team at Oracle

The Parallel Garbage Collector - Sip of Java

The Parallel Garbage Collector (GC), so named because it can utilize multiple threads for handling GC tasks, provides the highest throughput of GCs available on the OpenJDK. Let's take a look at the Parallel GC in this article.

Using the Parallel GC

The Parallel GC can be enabled using the VM arguments -XX:+UseParallel GC. As mentioned, the Parallel GC provides the highest throughput of the GCs available on OpenJDK; Serial GC, G1 GC, and Z GC, but this does come at the cost of pause times and memory footprint. So consider those impacts when deciding to use the Parallel GC.

Tuning Parallel GC

There are many options for tuning Parallel GC; a few key options to consider are the following.

Additional Reading

Happy coding!