The JVM will -Xms any memory specified for -Xms . Thus, it will request and allocate 2 GB of memory at startup. If later more memory is required (up to -Xmx ), the JVM will request more memory from the OS.
But, you know, you need this big memory? The main driver of memory consumption will be your application, not Tomcat. Simple webapps with multiple servlets or JSPs can easily run in less than 32 MB of heap. To determine the optimal tuning, you need to measure the application for performance / load.
Note: The preferred method for setting JVM parameters is JAVA_OPTS in setenv.sh rather than catalina.sh.
source share