Garbage Collector Java application does not free memory in POD Kubernetes [duplicate] Garbage Collector Java application does not free memory in POD Kubernetes [duplicate] kubernetes kubernetes

Garbage Collector Java application does not free memory in POD Kubernetes [duplicate]


Firstly, you have to identify the root cause of your problem to proceed further. I would suggest you to collect more information on the topic with -XX:+PrintGCDetails and -XX:+PrintGCTimeStamps. If your hypothesis that "Old Gen" pool is never frees the space is correct (honestly spearking, it's not obvious from the image), you might apply few tricks to deal with it as such:

  • Directly specify new and old gc sizes via -XX:MaxNewSize, -XX:NewSize, -XX:MaxOldSize, -XX:MaxOldSize to ensure that there is enough space for old generation
  • Gather more logs via -XX:+PrintGCDetails and -XX:+PrintGCTimeStamps to see if any issue happens due to over utilizing of one of the generations
  • Try to increase survivor space ratio via -XX:SurvivorRatio to expedite collection of the old generation objects