I am going to install Tomcat on linux with JVM Heap size as 2048m(2GB) to 2304m(2GB+256MB)
by setting CATALINA_OPTS="-Xms2048m -Xmx2304m"
in cataina.sh file
and the Linux OS have 8GB of the RAM
so i am making some points , please help with this
The JVM will pre-allocate whatever memory you specify for -Xms
. So, it will request and allocate 2GB of memory at startup. If it needs more memory later (up to -Xmx
), the JVM will request more memory from the OS.
But, do you know you need this much memory? The main driver of memory consumption will be your appication not Tomcat. Simple webapps with a few servlets or JSPs can easily run in less than 32MB of heap. You need to measure your application for performance / load to determine the optimal setting.
A side note - the preferred method for setting JVM parameters is with the JAVA_OPTS
setting in setenv.sh
, not catalina.sh.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With