The three "G1 of the New generation GC" of Java Virtual machine

Source: Internet
Author: User

Today began the actual combat Java Virtual Machine three: "Virtual machine working mode."

Total of 5 Series

    • One of the practical Java virtual machines" heap overflow processing "

    • Actual combat Java Virtual Machine Two" virtual machine working mode "

    • Real-time Java Virtual Machine three "G1 of the New generation GC"

    • Actual combat Java Virtual Machine Four "Disable System.GC ()"

    • Combat Java Virtual Machine Five "turn on JIT compilation "

The main task of the new generation GC is to reclaim the Eden and survivor areas. Once the Eden Zone is fully occupied, the new generation GC will start. The new generation GC collects before and after the heap data 5.6, where E represents the Eden area, s represents the Survivor area, and O indicates the old age. As you can see, the new generation GC deals only with the Eden and survivor areas, and after recycling, all Eden areas should be emptied, while the survivor area will be collected as part of the data, but there should be at least one survivor area, analogous to the other Cenozoic collectors, This does not seem to change much. Another important change is the growing region of the old age, as the objects of some survivor or Eden areas may be promoted to the old age.

650) this.width=650; "class=" Alignnone size-medium wp-image-584 "src=" http://www.uucode.net/wp-content/uploads/2015 /04/5-6-300x239.jpg "alt=" 5-6 "width=" "height=" 239 "style=" margin:0px;padding:0px;border:0px; "/>

Figure 5.6 G1 's new Generation GC

After the new generation GC occurs, if the Printgcdetails option is turned on, you can get a GC log similar to the following (only partial logs are given here, full logs and their analysis are shown in the 5th. 4.6):

1234567 0.336: [GC pause (young), 0.0063051 secs]….   [Eden: 235.0M(235.0M)->0.0B(229.0M) Survivors: 5120.0K->11.0M Heap: 239.2M(400.0M)->10.5M(400.0M)]  [Times: user=0.06 sys=0.00, real=0.01secs]

The log content of G1 is very rich compared to the logs of other recyclers. Of course, we are most concerned about the GC's pause time and the recovery situation. As you can see from the log, the Eden area was originally occupied with 235M space, was emptied after recycling, and the survivor Zone grew from 5M to 11M, because some objects were copied from the Eden zone to the Survivor area, the entire heap was 400M, and the total stack was reduced from 239M to 10.5M before recycling.

"Heap overflow processing" in one of the actual Java virtual machines

Virtual machine working mode for Java Virtual machine

Excerpt from

650) this.width=650; "class=" Alignnone size-medium wp-image-547 "src=" http://www.uucode.net/wp-content/uploads/2015 /03/25612fm%e7%ab%8b%e4%bd%93%e5%9b%be-228x300.jpg "alt=" 25612fm stereoscopic map "width=" 228 "height=" "style=" margin:0px; padding:0px;border:0px; "/>


The three "G1 of the New generation GC" of Java Virtual machine

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.