Tomcat Memory Allocations
Posted on 2015-01-05
I have a website running on Tomcat and I am trying to understand the memory allocation settings specifically the Java flags -Xms & -Xms and the Tomcat --JvmMs, JvmMx memory pool allocations.
Now I have read through numerous sites including Oracle and Tomcat specifications and underrstand that these flags are used to set minimum and maximum memory poo sizes and that this relates to Garbage Collection but what this escapes me is what is the difference between these two groups of settings.
I have found with testing that setting --JvmMs & JvmMx to something really low (10m) causes Tomcat to crash during start up (no errors logged) and that setting -Xms & -Xms to 10m allows Tomcat to start but causes the site to timeout. Given this I suspect that these two sets memory allocation are controlling different aspects of the website.
Can anyone out there explain the what each of these two groups control in relation to each other.
I also find it strange that when running Tomcat in exe mode that --JvmMs and JvmMx are not used, so why are they needed for running as a service?