Profile Image
ranajoy.paul

App pod automatically restarted due to long GC time

Plese find our current Pod configurations and we have 3 Pods out of which we could see one of the Pods gets restarted when JVM is getting full around 90%. Please suggest what would be the standard JVM setup which can stp this automatic restart due to garbege collection.

jvm="-Xms32G -Xmx32G"
request_cpu="6"
request_memory="44Gi"
limits_cpu="7"
limits_memory="44Gi"

 

 

This is our current JVM Options :

JAVA_OPTS_APP_PERF: "-XX:+UseParallelGC -XX:+DisableExplicitGC -Djxl.nogc=true -XX:InitialCodeCacheSize=32m -XX:ReservedCodeCacheSize=512m -XX:CompressedClassSpaceSize=512m -XX:MaxGCPauseMillis=1500 -XX:GCTimeRatio=9 -Djava.security.egd=file:/dev/./urandom"

 


Report URL - https://gceasy.io/my-gc-report.jsp?p=c2hhcmVkLzIwMjQvMDcvMTcvZ2NMb2dfYXBwXzE3MjA5Mzc3MDUudHh0LS0zLTI3LTEy&channel=WEB

    Please Sign In or to post your comment or answer

    Profile Image

    Kousika M

    Hello Ranajoy.paul,

    Greetings!

     

    The graph in the attached report indicates that your application is experiencing consecutive full GCs. This can lead to increased CPU consumption, spikes in CPU usage, and degraded application response times, potentially causing the application to become unresponsive.

     

    Consecutive full GCs suggest that the application requires more memory, likely due to insufficient JVM heap size. To resolve this issue, you can increase the heap size of your application or add additional JVM instances to distribute the traffic load. By doing so, the traffic volume handled by each JVM instance will be reduced.

     

    1. Increase JVM Heap Size

     

    Since consecutive Full GCs runs due to lack of memory, increasing JVM heap size should solve the problem. Say suppose you have allocated JVM heap size to be 2.5GB, then try increasing it to 3 GB and see whether it resolves the problem. JVM heap size can be increased by passing the argument: “-Xmx”.

     

    Example: -Xmx3G

     

    This argument will set the JVM heap size to be 3 GB. If it still doesn’t resolve the problem then try increasing the JVM heap size step by step. Over-allocation of JVM heap is also not good either, it might increase the GC pause time as well.

     

    2. Add more JVM instances

     

    Adding more JVM instances is an another solution to this problem.When you add more JVM instance, then traffic volume will get distributed. The amount of traffic volume handled by one single JVM instance will go down. If less traffic volume is sent to a JVM instance, then less objects will be created. If less objects are created, then you will not run into the consecutive Full GC problems.

     

    For a detailed understanding, you can refer to this blog post: ELIMINATE CONSECUTIVE FULL GCs.

     

    Thanks.

     

    Got something else on mind? Post Your Question