Minor GC and full GC

Source: Internet
Author: User

(1) Cenozoic (Eden + from Survior + to Survior) (proportional to 8:1:1, can be set by parameter –xx:survivorratio)

The JVM only uses Eden and one of its Survivor areas to serve objects at a time, and there is always a Survivor area that is idle.

The allocation was not guaranteed by the old age.

Old age: Arrays and large objects, which occur in the Cenozoic minor GC more than a certain number of times (default 15, can be set by-xx:maxtenuringthreshold) to move in objects

(2) Heap: Cenozoic + old age (approximately: 1:2, this value can be specified by parameter –xx:newratio)

Method Area: Permanent generation

Minor GC: occurs in the Cenozoic (replication algorithm) when the Eden Zone is full and survior does not cause a GC when full

Full GC: Refers to GC (marker cleanup algorithm) that occurred in the old age

(1) When the old age is full, the Gc,full GC will reclaim the young generation, the old generation

(2) The full GC will also be triggered when the permanent fill will cause the unload of class and method meta-information.


Minor GC, full GC trigger condition

Minor GC Trigger Condition: Minor GC is triggered when the Eden Zone is full.

Full GC Trigger conditions:

(1) when calling System.GC, the system recommends performing full GC, but does not necessarily execute

(2) Lack of space in the old age

(3) method to lack of space

(4) The average size of the old age after minor GC is greater than the available memory of the old age

(5) When the object size is larger than the available memory of the to space when it is copied from the Eden Zone and the From space area to the to space area, the object is dumped into the old age and the available memory in the old age is less than the object size


Frequently asked questions and solutions for full GC see this blog: Full GC


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.