No Full GC on JDK 17

Leo Korinth leo.korinth at oracle.com
Wed Jun 28 08:41:18 UTC 2023


I think it is better for you to trigger an explicit GC with System.gc() 
or using jcmd precisely when you want the heap reclamation.

At least -XX:+ExplicitGCInvokesConcurrent will work against my suggestion.

I hope this helps!

/Leo

On 28/06/2023 08:08, Sushant Kaushik wrote:
>    Hi All,
> I'm facing a peculiar issue where i do see a full GC intermittently but 
> i've not been able to figure out a deterministic way to trigger a full GC.
> I need full GC so that memory is allocated back to OS, this is for k8s 
> HPA scale down to work.
> Here is the JVM config that i'm using:
> 
>                    -Xmx9830M
> 
>              -Xms3200M
>                -Xlog:gc*:file=/tmp/gc.log:time,uptime
>                -server
>                -XX:MetaspaceSize=96m
>                -XX:+UseG1GC
>                -XX:MaxGCPauseMillis=200
>                -XX:+PrintFlagsFinal
>                -XX:InitiatingHeapOccupancyPercent=100
>                -XX:+ExplicitGCInvokesConcurrent
>                -XX:G1HeapRegionSize=16
>                -XX:MinMetaspaceFreeRatio=50
>                -XX:MaxMetaspaceFreeRatio=80
>                -XX:G1PeriodicGCInterval=5000
>                -XX:G1PeriodicGCSystemLoadThreshold=10.0
>                -XX:-G1PeriodicGCInvokesConcurrent
>                -XX:+UnlockDiagnosticVMOptions
>                -XX:-G1UsePreventiveGC
> 
> I've set InitiatingHeapOccupancyPercent to 100, because i don't want any 
> concurrent GC( i read because of concurrent GC, full GC won't be triggered).
> 
> Please help me out. TIA.
> 
> 
> _______________________________________________
> hotspot-gc-use mailing list
> hotspot-gc-use at openjdk.org
> https://mail.openjdk.org/mailman/listinfo/hotspot-gc-use



More information about the hotspot-gc-use mailing list