From sushant.iitbhu at gmail.com Wed Jun 28 06:08:56 2023 From: sushant.iitbhu at gmail.com (Sushant Kaushik) Date: Wed, 28 Jun 2023 11:38:56 +0530 Subject: No Full GC on JDK 17 Message-ID: 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. -------------- next part -------------- An HTML attachment was scrubbed... URL: From leo.korinth at oracle.com Wed Jun 28 08:41:18 2023 From: leo.korinth at oracle.com (Leo Korinth) Date: Wed, 28 Jun 2023 10:41:18 +0200 Subject: No Full GC on JDK 17 In-Reply-To: References: Message-ID: <76d439d7-1c96-4d99-2e38-6410307cca11@oracle.com> 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