Oracle proposes to use G1 as the default Garbage Collector for Java 9

Source: Internet
Author: User

Oracle proposes to use G1 as the default Garbage Collector for Java 9

Oracle is considering including JEP 248 in Java 9's JEP list, that is, using G1 as the default Garbage Collector in server configuration. This decision has sparked some debate in the Java Community, and many people think that the concurrent tag and scan (CMS) Collector may be more appropriate.

If this decision is put into practice, G1 will replace the parallel garbage collector as the default option for server configuration. As described in Oracle's memory management whitepaper, parallel garbage collectors are designed to run through Stop-The-World (STW) maximize application throughput with interruptions. The parallel Garbage Collector minimizes the total computing time consumed. In the long run, it is less destructive, so it can provide better overall performance. This collector is suitable for applications with low response time requirements, such as batch processing.

On the other hand, as Monica Beckwith, former head of G1 performance, previously stated on InfoQ, Garbage First (G1) was designed to minimize the STW interruption time at a higher computing cost. G1 is more suitable for low-latency applications, such as Web servers, which also reflects Stefan Johansson's motivation in JEP:

In general, limiting GC interrupt times is more important than maximizing throughput. Compared with throughput-oriented collectors (such as parallel garbage collectors), switching to a garbage collector with a short interruption time (such as G1) provides a better overall experience.

There is a controversy here. HotSpot introduced CMS for the same purpose. In fact, according to Oracle's description, CMS "is designed for applications that want to shorten the garbage collection interruption time, and applications that can share processor resources with the garbage collector at runtime ". Many public benchmark tests show that in applications with relatively small memory usage, the performance of CMS is often better than that of G1, which is consistent with the description of G1 in Oracle, that is, G1 is applicable to server applications with a heap size of 6 GB or above.

In a recent session, Performance Expert Kirk Pepperdine pointed out that Google has contributed a number of improvements to CMS, but they have never appeared in hot spot. He added that although G1 may be a better choice in the long run, the Oracle design scheme has deprived the community of the power to get a better experience from CMS.

Oracle Proposes G1 as the Default Garbage Collector for Java 9

 

Related Article

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.