I want my app to fails fast in case of insufficient memory, so it can be adjusted and the process restarted. I am running the service with
-XX:ParallelGCThreads=8
-XX:GCTimeRatio=19
-XX:ConcGCThreads=2
When heap memory runs out, GC1 keeps doing Full Garbage Sweeps, which are STW (Stop the World) events. It fights bravely but futile. jstat -gnew shows that for 10 consecutive FGC attempts it failed to secure more then 0.03% of Olg Den space
I looked into GC1 docs but I cannot find a suitable options to instruct GC1 to throw OutOfMemory when it cannot reclaim more then 0.05 % going from 100 in lets say 5 FGC attempts. Any ideas? Thanks