When was the Java GC, and what did it do to something?

Source: Internet
Author: User

1. The new generation has an Eden area and two survivor zones, first placing objects in the Eden area, and placing them on one of the survivor areas if there is not enough space, and if they still do not fit, it will trigger a minor GC that occurs in the Cenozoic. Put the surviving object in another survivor area, then empty the memory of Eden and the previous survivor area. In a GC, if you find objects that still don't fit, put those objects into memory in the old age.

2. Large objects and long-lived objects go directly into the old age zone.

3. Each time the minor GC is executed, the object to be promoted to the older age should be analyzed, and if the older objects in the old age area are now larger than the remaining size of the old age area, perform a full GC to maximize the space in the old area.

What to do: No search from the GC roots, and there are no resurrected objects after a token cleanup.

What to do: The New generation: replication cleanup; old age: Tag-purge and tag-compression algorithms; permanent: the class loader itself that holds classes in Java and loads classes.

What are GC roots:

  1. Referenced objects in the virtual machine stack
  2. Object referenced by a static property in the method area, the object referenced by the constant
  3. The object referenced by JNI (that is, generally speaking, the native method) in the local method stack.

    Links: Java gc stuff (UP)

    Links: Things to do with Java GC (bottom)

    Links: Introduction to CMS garbage collector

When was the Java GC, and what did it do to something?

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.