I have set the following JVM parameters for the tomcat container,
JAVA_OPTS=-XX:+UseG1GC -XX:+UseStringDeduplication -Xms512m -Xmx4096m -XX:-UseGCOverheadLimit -XX:MaxHeapFreeRatio=30 -XX:MinHeapFreeRatio=10
Any suggestions on this? how to define release of memory (RAM) dynamically?
If not, what is the java version you are using? Jvm prefers taking more memory than it needs to, but that behaviour should have been improved in java 12. Do you experience any problems with the memory consumption? Does your container crash at any point? There are couple of additional flags you can try: -XX:+UseContainerSupport, -XX:+UseCGroupMemoryLimitForHeap.
Thank you so much for your response. We are using java 1.8 and now testing with different versions of java, tomcat etc. The container doesn’t crash but keeps occupying the memory even after the job (i. e import/export etc) is done.
Will share if adding those additional flag solve the problem.