简体   繁体   中英

G1GC - How to check if the humongous objects is a bottleneck in GC?

My Java application generated the following parts of logs:

[2022-04-15T08:30:22.722+0000][debug][gc,humongous      ] GC(1574) Live humongous region 926 object size 3914888 start 0x0000000673c00000  with remset 2 code roots 0 is marked 0 reclaim candidate 0 type array 1
[2022-04-15T08:30:22.722+0000][debug][gc,humongous      ] GC(1574) Live humongous region 942 object size 3913024 start 0x0000000675c00000  with remset 1 code roots 0 is marked 0 reclaim candidate 0 type array 1
[2022-04-15T08:30:22.722+0000][debug][gc,humongous      ] GC(1574) Live humongous region 944 object size 3912448 start 0x0000000676000000  with remset 2 code roots 0 is marked 0 reclaim candidate 0 type array 1
[2022-04-15T08:30:22.722+0000][debug][gc,humongous      ] GC(1574) Live humongous region 954 object size 3915320 start 0x0000000677400000  with remset 1 code roots 0 is marked 0 reclaim candidate 0 type array 1

From my understanding, it means the humongous regions are up to 954, if one region is taking 2mb then it's up to 2gb taken by the humongous regions. Am I correct?

Is there any better way/tool of finding the humongous objects?

Answer my question:

Live humongous region 926

It means the live humongous objects take 926 regions.

object size 3915320

It means total humongous objects take 3,915,320(Byte)

The humongous objects don't mean it's terrible. Sometimes your application level cache might be kept in the old generation as humongous objects.

And after each GC, there's information on how many regions were freed:

[<timestamp>][info ][gc,heap       ] GC(14) Eden regions: 111->0(1217)
[<timestamp>][info ][gc,heap       ] GC(14) Survivor regions: 12->11(16)
[<timestamp>][info ][gc,heap       ] GC(14) Old regions: 13->15
[<timestamp>][info ][gc,heap       ] GC(14) Humongous regions: 12->12

From this message, you can have an idea of how many humongous regions it used and decide if it needs to be tuned.

Source code: https://github.com/openjdk/jdk11u/blob/master/src/hotspot/share/gc/g1/g1CollectedHeap.cpp#L4537

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM