GC recovery process

Java's GC heap space can be divided into young generation (new Generation) and old generation (old Generation), new Generation is divided into Eden, From, To area. The default ratio of its size is 8:1:1. New objects are always created in the Eden Space. When the Eden area is full, the Monitor GC will be triggered, and the reads and writes that are still in use will be copied from the Eden area to From area, and then clear the Eden area; in this way, the Eden area is empty, and new objects can continue to be created in Eden. When Eden is full again, the Monitor GC is triggered to copy the still surviving objects in the Eden and From areas to the To area, and then empty Eden And the From area; when the Eden area is full again, trigger the Monitor GC to copy the objects still alive in the Eden and To areas to the From area, and then clear the Eden and To areas. In this way, the object in the new Generation still survives after each Monitor GC, and the age is +1 years old. When he reaches the age of 15 and has not been GCed, he will be upgraded to the Old Generation. When the Old Generation area is full, Full GC will be triggered, and Full GC will have a greater impact on system performance. Therefore, according to the characteristics of the system, the size of the new Generation and the old Generation should be reasonably set, and the Full GC should be minimized.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326803342&siteId=291194637