Full GC and Minor GC, innocently could not tell

This article describes the various GC to lower the JVM for people to figure out these concepts.

You may have seen a lot of GC nouns, such as: Minor GC, Young GC, Full GC, Old GC, Major GC, Mixed GC.

So much the concept, think of all headaches, what in the end all kinds of mess GC referring to?

The following quote from R at the large-known almost the answer:

For realization HotSpot VM, which is actually inside the GC accurately classified in two ways:

  • The Partial GC (partial GC): GC mode does not collect the entire heap
    • Young GC: Young Gen collect only the GC, Young GC there are kinds of argument is called Minor GC
    • Old GC: only collect old gen of GC, only the garbage collector CMS is the pattern of concurrent collection
    • Mixed GC: Young Gen entire collection as well as some old gen of GC, G1 garbage collector only has this model
  • Full GC: collect the entire heap, including the new generation, old time, permanent generation (in JDK 1.8 and later, permanent generations removed, replaced metaspace dimensional space) and other models all parts

Let us come to know at each GC:

(1)Minor GC / Young GC

First, let's look at the Minor GC / Young GC, as we all know, the new generation (Young Gen) can also be called the young generation, these two terms are equivalent. Then after Eden younger generation memory area is full, you need to actually trigger the young generation GC, or the new generation of GC.

At this time, this new generation GC, in fact, the so-called Minor GC, also can be called Young GC, these two terms, I believe we understand, put it plainly, it is designed for the new generation of GC.

(2)Old GC

The so-called old's GC, called Old GC is more appropriate, because it can be understood from the literal sense, this is the so-called old's GC.

But here's the reason why we put the old GC called Full GC, in fact, is also possible, but is literally a variety of different argument.

For a more accurate representation of the meaning of this old's GC, GC years old can be called the Old GC.

(3)Full GC

For Full GC, in fact, there is a more appropriate here to say, that Full GC for garbage collection refers to the entire memory space of the new generation, old time, permanent generation, so called Full GC.

Can also be understood from the literal meaning, Full is the overall mean, it is to be a whole JVM garbage collection, the garbage each memory area are recovered off.

(4)Major GC

There is a term called Major GC, this fact is generally use less, he is also a very easy concept confusion.

Some people Major GC with Old GC equivalent up, thinking that he was against GC old age, it was also the Major GC and Full GC equivalent up, that he is GC for all JVM memory area.

So for this confusing concept, I suggest that you put less in the future. If you hear someone say that Major GC concept, we can ask, in the end he was trying to say Old GC it? Full GC or do?

(5)Mixed GC

Mixed GC is G1 in a unique concept, in fact, plainly, the main that is in G1, once the old year accounted for 45% of heap memory (- XX: InitiatingHeapOccupancyPercent: Set the Java heap occupancy threshold trigger markers cycle, the default value is 45 %. Java heap here refers to the proportion of non_young_capacity_bytes, including old + humongous), will trigger Mixed GC, this time for the young generation and the old year will be recycled. Mixed GC appear only in G1.

reference

https://tech.meituan.com/2016/09/23/g1.html

https://www.zhihu.com/question/41922036/answer/93079526

"In-depth understanding of the Java Virtual Machine: JVM advanced features and best practices (3rd Edition)"

Guess you like

Origin www.cnblogs.com/wupeixuan/p/12198189.html