O'Reilly logo

Java EE 8 High Performance by Romain Manni-Bucau

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required