Parallel Collector - "+XX:+UseParallelGC"
This chapter provides tutorial notes and example codes on the Parallel Collector specified by the '+XX:+UseParallelGC' JVM option. Topics include introduction to Parallel Collector log message format; '-XX:+PrintGCTaskTimeStamps' option to display GC threads.
What Is Parallel Collector
Parallel Collector GC Log Message Format
"-XX:+PrintGCTaskTimeStamps" - Print GC Threads
"-XX:ParallelGCThreads=n" - # of Threads
Parallel Collector Stops Application for Minor/Major GC
PSYoungGen Collector Using Tenuring Age
Parallel Collector Changing NewRatio and SurvivorRatio
Parallel Collector Adaptive Size Policy
Adaptive Size Policy Log Messages
"-XX:+PrintAdaptiveSizePolicy" - Minor GC Report
Adaptive Size Policy Changed Survivor Space
Adaptive Size Policy Changed Eden Space
Adaptive Size Policy for Best Latency
Adaptive Size Policy for Best Throughput
- The Parallel Collector, -XX:+UseParallelGC, actually
uses the Parallel Scavenge (PS) Collector of the Young generation
and the Parallel Old Collector of the Tenured generation.
- The Parallel Collector can be invoked by "-XX:+UseParallelGC" or
-XX:+UseParallelOldGC" JVM option.
- The Parallel Collector uses "PSYoungGen" to represent Young Generation GC
in log messages.
- The Parallel Collector uses "ParOldGen" to represent Tenured Generation GC
in log messages.
- The Parallel Collector performs both Minor and Major GCs
in a stop-the-world fashion and parallelly using multiple threads.
- When the Parallel Collector is performing GC in multiple threads,
the application is still stopped. The Parallel Collector is not running parallely against
the application. It is running parallely with its multiple GC threads.
- The Parallel Collector is also called Throughput Collector
because it reduces GC time to improve the throughput of the application.
It's a good choice for backend applications.
- The number of threads used by the Parallel Collector
can be controlled by the "-XX:ParallelGCThreads=n" JVM option.
- The Parallel collector performs minor GC and major GC in
- The Parallel collector can not print the tenuring age distribution list
at each Young GC.
- The Parallel collector changes NewRatio and SurvivorRatio
dynamically even they are specified at the command line,
because of the default Adaptive Size Policy.
Table of Contents
About This Book
Heap Memory Area and Size Control
JVM Garbage Collection Logging
Introduction of Garbage Collectors
Serial Collector - "+XX:+UseSerialGC"
►Parallel Collector - "+XX:+UseParallelGC"
Concurrent Mark-Sweep (CMS) Collector - "+XX:+UseConcMarkSweepGC"
Garbage First (G1) Collector - "+XX:+UseG1GC"
Object References and Garbage Collection
Garbage Collection Performance Test Program
Performance Tests on Serial Collector
Performance Tests on Parallel collector
Performance Tests on Concurrent collector
Performance Tests on G1 collector
Garbage Collection Performance Test Summary
Full Version in PDF/EPUB