7.15.2 Relationship between the lifespan of an object and its age
The number of times young GC or mixed GC is executed for an object is called the age of the object.
The following figure shows the relation between the lifespan and the age of an object.
|
|
After the application has started, the initialization process has completed, and the young GC or mixed GC has been executed a certain number of times, objects with a long lifespan that will be needed for a long time move to the Tenured area. As a result, the Java heap stabilizes shortly after the application starts, and most of the Java objects that are created are objects that have a short lifespan. If the New area has been tuned appropriately, then the majority of objects created after the Java heap stabilizes are objects with a short lifespan that are collected during the first young GC or mixed GC.