I have Apache Tomcat 7.0.27 installed on a 64 bit CentOS server with 37G of physical memory available. For the web application I'm running in Tomcat I need a large amount of memory available so I've set up my Tomcat setenv.sh similar to below:
export JAVA_OPTS="
-Xms30g
-Xmx30g
-XX:PermSize=256m
-XX:MaxPermSize=256m
-XX:NewSize=6g
-XX:MaxNewSize=6g
-XX:SurvivorRatio=8
-XX:+DisableExplicitGC
-XX:+UseConcMarkSweepGC
-XX:+UseParNewGC
-XX:+UseCMSInitiatingOccupancyOnly
-XX:CMSInitiatingOccupancyFraction=80"
My Java version is:
java version "1.6.0_41"
Java(TM) SE Runtime Environment (build 1.6.0_41-b02)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01, mixed mode)
The application starts and runs fine when I run {tomcat_home}/bin/startup.sh but occasionally when I shutdown with {tomcat_home}/bin/shutdown.sh I get the following message:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Why is this happening?