Minor GC, major GC, Full GC trigger conditions

 

Years old (Old generation)

Not become unreachable objects, and survived from the new generation, it is copied here. It occupies space than the new generation and more. Also due to its relatively large space, take place in the old GC's much less than the new generation. Object disappears from the old era process, which we call ** "major GC" **

minorGC is to clean up the integration YouGen process, to clear up the eden, S0 \ S1 are due MinorGC
Allocation Failure (less than YoungGen area of memory, enough to call) triggers minorGC

Minor GC trigger conditions: when the Eden area is full, trigger Minor GC. But will for the new generation

 

Major GC clean up OldGen.

Unfortunately, it is actually a bit more complicated and confusing. First, many Major GC is triggered by the Minor GC, so in many cases these two GC separation is unlikely. On the other hand, many modern garbage collection will clean up part of the permanent generation of space, so use the "cleaning" of the term is only partially correct.

This allows us to not have to care about in the end is called the Major GC or Full GC, we should be concerned about whether the current GC stop all application threads, or concurrent treatment can be stopped without threaded applications.

Full GC trigger conditions:

Full GC definition is relatively clear, is for the entire new generation, old generation, element space (metaspace, java8 later replaced perm gen) of GC global scope;

  1. When you call System.gc (), the system proposes the implementation of Full GC, but not necessarily execution
  2. Old's lack of space
  3. The method is insufficient space area
  4. The average size by Minor GC after entering old age old age is greater than the available memory
  5. Region of Eden, From time to copy the To Space Space zone area, the object Space available memory size is larger than the To, the object put dump year old, old age and the available memory is less than the size of the object

 System.gc () this thing to be reminded that Full GC, not the Minor GC.

Guess you like

Origin www.cnblogs.com/nyhhd/p/12641370.html