I have been trying to get the Memory parameters set in Catalina.bat for Tomcat starting in a command window.
I need a start of -Xms1536m -Xmx2048m.
I am able to use the Set JAVA_OPTS= -Xms1536m to pass one parameter, which works and Tomcat starts my WAR files.
When I try two parameters at the same time, I get heap errors and unpredicable responses.
Below are several different attempts that did not work.
I am using Vista with 4G of RAM.
rem set JAVA_OPTS = '-Xms1536m -Xmx2048m' did not work
rem SET JAVA_OPTS = '-Xmn1536m -Xmx2048m' did not work
rem set JAVA_OPTS='-Xms1536m -Xmx2048m' did not work
rem set JAVA_OPTS= '-Xms1536m' did not work
rem set JAVA_OPTS='Xms1536m' did not work
rem set JAVA_OPTS=-Xms1536m This one works to start web services on 2010-05-31
They were helpful in the trouble shooting. It turns out that single quotes or double quotes are not the solution. However, when testing I got the message during shutdown of a startup - - Incompatible initial and maximum heap sizes specified.
As I continued to trouble shoot this I found the following website and notes.
• Only setting -Xms JVM option and its value is greater than the default maximum heap size, which is 64m. The default minimum heap size seems to be 0. For example,
java -Xms128m BigApp
Error occurred during initialization of VM
Incompatible initial and maximum heap sizes specified
The correct command should be java -Xms128m -Xmx128m BigApp. It's a good idea to set the minimum and maximum heap size to the same value. In any case, don't let the minimum heap size exceed the maximum heap size.
I then experimented with multiple combination and discovered that for this Vista with 4 G of RAM that when I exceed 1536m the tomcat server will not start or will crash with heap errors.
My working solution was to set the JAVA_OPTS= -Xms1536m -Xmx1536m. This repeatly worked. No single quotes or double quotes. Quotes or double quotes also caused errors.
When I moved 1536 to 2048 then the tomcat server would not start.