JAVA GC Simple Summary

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.