Tomcat memory utilization on Docker Containers

39 views Asked by At

I am curious about tomcat memory utilization on docker containers. I hosted one of my personal project on tomcat server specifically web application but the problem I am facing is that the memory utilization is always remaining higher side. My base image is alipne. I did memory profiling of my application in local build; I resolved some minor errors indeed facing same issue.
I am curious about below points -

  • What is exact behavior of tomcat on container about memory? To be specific with me when it reaches some certain level like 50% it holds at that position not decreasing down.
  • I mentioned max heap size in catalina.sh file still the same behavior and also mentioned some configuration like : +UseG1GC -XX:+UseStringDeduplication

I need to find ideal tomcat memory utilization on docker containers.

1

There are 1 answers

2
Panagiotis Bougioukos On

I need to find ideal tomcat memory utilization on docker containers.

This would not be able to be provided to you in such simple question, like it exists a defacto solution to satisfy your above requirement.

What normally happens in such situations is called fine tuning. When you have deep understanding both of the infrastructure and the application which you have deployed you can optimize your memory utilization using some VM arguments. But as said this does not exist as a defacto solution. Most probably could be obtained through trial and error and deep understanding of your application.

It is also normal that during fine tuning you identify some vulnerabilities in your application code which need to be handled as for your deployed server and application to be able to work more optimal.