Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Reclaim JVM Committed Memory when using G1GC to scale down system

$
0
0

I am running dropwizard REST Applications on AWS ECS (Docker Containers).Application sizes vary from 512MiB, 1/4/8 GiB.I am using G1GC.

Under high load,JVM used heap increases (with sawtooth pattern).Hence, the committed memory of JVM increases as well.

When the load on application decreases back to idle (in my test, there is no load at all), the JVM committed memory is not released.Used heap has sawtooth pattern, but the spikes are much larger (My guess is JVM is using more heap memory before young garbage collection triggers as committed memory exists).

ECS task (~kubernetes pod) memory usage considers JVM committed memory to calculate used memory.

I want JVM to release the committed memory after the spike in load, so that ECS task memory utilization decreases, thereby we can scale down our system based on ECS-Task memory usage metric.

I am trying to use -XX:MaxHeapFreeRatio to ensure memory is released, but this only works during full GC cycle, which doesn't get triggered (unless I manually trigger it).I think G1GC tried to prevent full GC.

My question is, how can I trigger full GC or how can I ensure committed memory is released back so that my system can be scaled down based on memory usage metric.

enter image description here


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>