G1GC
Thomas Schatzl
thomas.schatzl at oracle.com
Thu Dec 21 08:51:22 UTC 2023
Hi,
On 21.12.23 08:35, 劉俠麟 wrote:
> When using G1GC with jdk11u, I met some cases that g1gc failed to work
> well and seriously affected the Java application. Here are some details:
>
> 1. With objs promoted to old generation, as well as some humongous objs
> allocated, the old generation usage exceeds the threshold indicated
> by IHOP.
> 2. G1GC startups concurrent marking.
> 3. Concurrent marking is finished, but the Eden is not full and mixed
> GC can not be triggered.
> 4. Humongous objs keep being alllocated and finally cause a to-space
> exausted.
> 5. Eventually, G1 triggers a Full GC for collecting all objs.
>
>
> I've met plenty of cases which act the same as I described below. I'm
> confused that it looks like a wrong prediction for old generation
> growing. Is it fixed in higher JDK version? Or what should I do to deal
> with such problems. Looking forward to your reply!
> Thanks!
thanks for your problem report.
Trying out later JDK versions is always a good idea, as there have been
numerous improvements also to humongous object handling since JDK 11,
but I am not sure this will fix the issue.
Without logs it is hard to say what exactly the reason for the failure
could be, and whether the (overall) allocation rate/live set size simply
exceeds what g1 can handle or not.
One option, without increasing heap size, that works with all JDK
versions is to reduce the amount of humongous objects by increasing the
region size via the -XX:G1HeapRegionSize option. Just start with
doubling it (you can get the current value by starting with
-XX:+PrintFlagsFinal) and see what works.
Do you happen to be able to provide a small reproducer?
Hth,
Thomas
More information about the hotspot-gc-dev
mailing list