The types of GC collections in Java are mainly of several useserialgc,useconcmarksweepgc,useparnewgc,useparallelgc,useparalleloldgc,useg1gc, And how these parameters match, in fact, just look at the following code is very clear
bool arguments::check_gc_consistency () {bool status = TRUE; Ensure that's user has not selected conflicting sets//of collectors.
[Note:this check is merely a user convenience; Collectors over-ride each other so, a non-conflicting//set is selected; However what the user gets isn't what they/may have expected to the combination they for.
It ' s//better to reduce user confusion from not allowing them to//select conflicting combinations.
UINT i = 0;
if (USESERIALGC) i++; if (USECONCMARKSWEEPGC | |
USEPARNEWGC) i++; if (USEPARALLELGC | |
USEPARALLELOLDGC) i++;
if (USEG1GC) i++; if (i > 1) {jio_fprintf (Defaultstream::error_stream (), "Conflicting collector combinations in Opti On List;
"" Please refer to the release notes for the "combinations" "allowed\n");
Status = FALSE;
} return status; }
We divide the GC into 4 different types.
1. SERIALGC
parameter-XX:+USESERIALGC
Young and old are all using the serial garbage collection algorithm, 2. PARALLELGC
parameter-XX:+USEPARALLELGC
Young area: Using parallel scavenge recovery algorithm
Old zone: A single-threaded or parallel garbage collection algorithm can be used, controlled by the-XX:+USEPARALLELOLDGC 3. CMS
parameter-XX:+USECONCMARKSWEEPGC
Young area: You can use a common or parallel garbage collection algorithm, controlled by parameter-XX:+USEPARNEWGC
Old zone: Only concurrent Mark Sweep 4 can be used . G1
Parameters:-XX:+USEG1GC
No Young/old area.