The Oracle Garbage-First GC algorithm (available in Java 8 and the default option in Java 9) is a parallel / parallel GC algorithm, so more than one thread is involved. In particular, there are a number of threads for garbage collection:
- ParallelGC Threads are the threads that are used during the βstop the worldβ collection phase.
- Parallel marking streams (or parallel GC streams) are streams used to mark regions as candidates for cleaning and starting without stopping application streams.
- Joint refinement G1 Themes are responsible for marking changes in a separate register, marked by a set of links
G1GC can be enabled by setting -XX:+UseG1GC
(note that although it was available in Java 7 G1GC at that time was unreliable, so do not use it during production (and since Java 7 is complete, you should not use this in production)).
sources https://blogs.oracle.com/g1gc/entry/g1gc_faq and http://www.oracle.com/technetwork/articles/java/g1gc-1984535.html
source share