Serial Collector
Serial is a new generation collector; single-threaded garbage collector with a copy algorithm
-xx:+useserialgc
Parnew Collector
Parnew is a new generation collector; The Parnew collector is actually a multithreaded version of the serial collector, and the remaining behaviors include all the control parameters available to the serial collector, the collection algorithm, the Stop the world, the object assignment rule, The recycling strategy is exactly the same as the serial collector;
The control parameters are as follows:
-xx:+useparnewgc
-xx:survivorratio//Cenozoic Edge region Survivor Area capacity ratio, default is 8, representing Edge:survivor = 8:1
-xx:pretenuresizethreshold//Direct promotion to the old age object size, set this parameter number of objects greater than this parameter directly allocated in the old age
-xx:handlepromotionfailure//Whether to allow the new generation to collect the guarantee, once minor GC, another piece of survivor space is insufficient, will be directly in the old age to retain
-xx:parallelgcthreads//Set parallel GC for recycling, number of parallel threads
Parallel Scavenge Collector
Parallel Scavenge is a new generation collector, is also using the copy algorithm collector, from the name of the Parallel scavenge collector, the same as the Parnew collector, are parallel collection, and all use the copy algorithm, but Parallel Unlike other collectors such as CMS, the scavenge collector is focused on minimizing the time a user thread pauses while garbage collection is being used, while the parallel scavenge collector target achieves a manageable throughput (throughput). The so-called throughput is the ratio between the time the CPU user runs the user code and the CPU's total elapsed time.
The short pause time is suitable for human-computer interaction program, and high throughput can efficiently use CPU time, as soon as possible to complete user tasks, suitable for the background budget and do not need too many interactive tasks.
Parallel scanvenge Mobile Phone two parameters can control the throughput accurately:
-xx:maxgcpausemillis//Maximum garbage collection pause time is greater than 0 milliseconds, and the collector is as secure as possible that the value of the memory recycle does not exceed this setting
-xx:gctimeratio//sets an integer greater than 0 less than 100, the ratio of garbage collection time to total time, if the value is set to 19 to allow GC time to occupy 5% 1/(1+19), the default value is 99, which is the maximum allowable 1%
-xx:+useadaptivesizepolicy//Open switch without specifying parameters such as the size of the new generation age, the collector will dynamically specify the size of the space
Serial Old Collector
Serial old is an older version of the Serial collector, and he is also a single-threaded collector using the "mark-and-organize" algorithm;
Parallel Old Collector
The Parallel old collector is an older version of the Parallel scavenge collector, using multithreading and the "mark-and-organize" algorithm, which is provided after the JDK 1.6 version of the Parallel old collection algorithm, before Parallel scavenge Collector status is more embarrassing, because if the new generation chose the Parallel Scanvenge collector, the old age in addition to the serial (PS MarkSweep) collectors have no choice; because the old age in the serial of the collector in the server performance of the drag, The parallel Scanvenge collector may not be able to achieve optimal throughput overall; knowing that the parallel old collector appears, the "throughput first" collector finally has a more real-world combination of applications that focus on CPU throughput, Parallel scanvenge plus parallel old collector can be given priority.
CMS Collector
The CMS (Concurrent Mark Sweep) collector is a collector that targets the shortest recovery pause time. At present, a large part of the Java application is concentrated in the Internet station or b/s system service side, such applications pay particular attention to the corresponding speed;
From the name Mark sweeps, you can see that the CMS collector is implemented based on the "tag-clean" algorithm, which is relatively complex with several other collectors, and the whole process is divided into four steps:
1) Initial mark (CMS inital mark) Stop the World tag GC roots directly associated to the object
2) concurrent tagging (CMS concurrent mark) GC Roots Tracing
3) Re-mark (CMS remark) Stop the World fix 2) step conflict with user thread section
4) Concurrent Purge (CMS cuncurent sweep) Clears unreachable objects
The recycle thread at the start of the CMS collector is the default (number of CPUs + 1)/4 concurrent junk phone threads not less than 25% CPU resources
G1 Collector
G1 (Garbage-first) collector is one of the most cutting-edge achievements in the development of collector technology today; G1 's mission to replace the CMS collector
G1 Features:
1) Parallelism and concurrency
2) Collection of generations
3) Space Integration
4) Predictable pauses
The order of the G1 collectors is very similar to the CMS collector sequence, with the main difference being in the memory partitioning model and the recovery algorithm