Parallel and parallel compacting collectors

The parallel collector is close to the serial collector (which is why it is important to understand the serial algorithm). The main difference will be how it sets up the collection. We saw that, in a serial collection, a single thread is responsible for the collection, but with the parallel collector, multiple threads adopt the role. This means that you can hope to reduce the stop the world duration (when the garbage collector enforces the application to stop responding and do its job) by the number of threads (theoretically).

This can be activated/enforced (this is supposed to be the default for a server machine) by adding this option on the JVM: -XX:+UseParallelGC.

The parallel collector can be ...

Get Java EE 8 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.