GC Sub-generation
The GC's English spelling is garbage Collection, which means garbage collection.
Java divides heap memory into three generations to manage:-Young generation ( Young Generation )-old generation () Old Generation -Permanent ( Perm Generation )
Young generation: Also divided into, Eden From and To , which From and To also collectively referred to as Survivor Spaces (Survivor area). The young generation size can be -Xmn controlled by, or used to control, -XX:SurvivorRatio Eden Survivor the proportions used –XX:NewRatio to specify the size of the Cenozoic and older generations.
Older generation: Objects that are used to store multiple garbage collections that are still alive.
Permanent generation: To store the method area. You can -XX:PermSize -XX:MaxPermSize specify minimum and maximum values by and.
Normally, an object from creation to destruction, should be from Eden , then to Survivor Spaces (survivor), then to Old Generation (old generation), and finally disappeared under a GC. It is also possible for an object to die directly in Eden , or to Old Generation survive (in old generations).
GC Type
Java GC is divided into two categories:
Minar GC
FULL GC
Major GC
Minar GC: Recovering memory from young generation spaces (including Eden and Survivor regions) is called the Minor GC.
Major GC: is to clean up the old age.
Full GC: is to clean up the entire heap space-including the young generation and the old age.
GC, it pauses the world ( stop-the-world ), meaning to stop all application threads, so to avoid unnecessary GC has improved performance.
GC Log
-XX:+PrintGCDetailsPrint log details.
-XX:+PrintGCTimeStampsPrint the timestamp.
-XloggcOutput GC log to file.
JAVA GC Simple Summary