Oracle is considering including JEP248 in the Java 9 JEP list, that is, using G1 as the default Garbage Collector in server configuration. This decision caused some contention in the Java Community.
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 caused some contention in the Java Community.
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. For most users, compared with throughput-oriented collectors (such as parallel garbage collectors), switching to a garbage collector with a short interruption time (such as G1) can provide a better overall experience.
There is a controversy here. HotSpot introduces CMS for the same purpose, but in fact, according to the CMS, the application is designed 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
This article permanently updates the link address: