Java-100 Advanced -GC species Tian knowledge - Knowledge Shop (six)

Knowledge Shop: Light to build knowledge, continuously updated each time less knowledge, the reading is not tired. Does not account for too much time, kept the knowledge to awaken your deep memories.

file

A, GC retriever four indicators:

1.Throughput, the proportion of non-gc time and total running time.

2.Pauses, gc pause times during the program, the average length of the pause, the maximum time.

3.Footprint, currently used heap memory size.

4.Promptness, no reference to how long the object was only gc.

Second, the serial garbage collector

 Principle: to suspend all worker threads, one by one memory area to collect.

 Recommendation: C generally for a user terminal not recommended.

 Command: -XX:+UseSerialGC

 On behalf of collector: 

   ⑴ Serial for the new generation

   ⑵ Serial old for the old year

file

Third, the parallel garbage collector

  Principle: Using multi-threaded garbage collection

  Recommendation: to the primary server throughput

  Command: -XX: + UseParallGC

  On behalf of collector:

   ⑴ ParNew for the new generation

  ⑵ Parallel Scavenge for a new generation to the main throughput

⑶ Parallel Old for old time, throughput bit to master, can be used in conjunction with ⑵

file

Third, the concurrent mark scanning CMS garbage collector

  Principle: multi-threading, labeling clean-up, the old general's use, trigger Full GC

  Recommendation: in response to time-based server

  Command: -XX: + UseConcMarkSweepGC

  On behalf of collector: CMS

  Features:

        1. twice a brief pause, a long pause instead of sorting algorithms

        2. To improve response time, throughput decreased.

     3. Fragmentation occurs, with the command 

            -XX:+UseCMSCompactAtFullCollection 

            -XX: CMSFullGCsBeforeCompaction = 1 years old compression finishing the configuration memory compression is performed once after how many times Full GC.

            -XX: ParallelGCThreads configure the number of concurrent garbage collection thread

file

(4) .G1 garbage collector

    Principle: memory segmentation, different regions.

    Recommendation: big heap memory using server-side apply.

    Features: Parallel Concurrent recovery, memory compression, finishing marker

This article from the zshipu.com study notes or organize or reproduced, if infringement please contact, it will change.

Guess you like

Origin www.cnblogs.com/sblig/p/11938642.html