- Java 11 and 12:New Features
- Mala Gupta
- 300字
- 2021-07-02 12:27:06
Understanding G1 GC logs
In this section, we will have a look at the G1 GC logs in detail.
The following features are marked in the following screenshot:
- Each heap region is of the size, 1M.
- The JVM is using G1 as its GC.
- The G1 collector starts a young collection 0.309 seconds after starting the application execution.
- The G1 collector uses multiple threads for the young collection.
- The G1 collector moves live objects from 14 Eden regions to 2 Survivor regions:

Let's examine another section of the same GC log, as follows:

The logs in the preceding screenshot are part of the same GC collection (note GC (5) in the logs). It shows logs from another young collection by the G1 GC. I've highlighted the Eden, Survivor, Old, and Humongous regions that the collector worked on. The values on the left side of the arrows show the counts of regions before the collection, and the values on the right are the counts of regions after the GC.
Let's examine the last section of the G1 log before the JVM quits with OutOfMemoryError, as follows:
- The collection uses multiple threads for the full collection.
- Full GC starts.
- Full GC includes a multiple number of steps, including marking live objects, preparing for compaction, adjusting pointers, and compacting the heap.
- As you will notice, there are no more Eden regions and Survivor regions available for allocation and compaction (0 -> 0). The Old and Humongous regions contain live objects that can't be collected. As a result, the JVM shuts down with OutOfMemoryError.
- This information logs the actual time taken by the full GC:

The bottom of the preceding screenshot includes a few final statistics, including total heap size, used heap size, region size, and more.
- 微服務(wù)設(shè)計(jì)(第2版)
- Microsoft Dynamics 365 Extensions Cookbook
- Learning Informatica PowerCenter 10.x(Second Edition)
- Java面向?qū)ο蟪绦蜷_(kāi)發(fā)及實(shí)戰(zhàn)
- Mastering Scientific Computing with R
- HTML5游戲開(kāi)發(fā)案例教程
- 網(wǎng)站構(gòu)建技術(shù)
- ASP.NET程序設(shè)計(jì)教程
- 微信小程序開(kāi)發(fā)與實(shí)戰(zhàn)(微課版)
- Java Web開(kāi)發(fā)就該這樣學(xué)
- 零基礎(chǔ)學(xué)C語(yǔ)言第2版
- Django 3.0入門(mén)與實(shí)踐
- .NET Standard 2.0 Cookbook
- JavaScript機(jī)器人編程指南
- 大數(shù)據(jù)時(shí)代的企業(yè)升級(jí)之道(全3冊(cè))