This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do you set mutliple memory parameters in Catalina.bat?

 
Jerry Haines
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

set JAVA_OPTS=-Xms1536m

rem set JAVA_OPTS=-Xms1536m This one works to start web services on 2010-05-31


 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to our Tomcat forum.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18020
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using double-quotes instead of single quotes. That is:


 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this a Vista thing? I have used



in catalina.bat for Windows XP for years.

Bill
 
Jerry Haines
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you each for your reply.

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.

website http://javahowto.blogspot.com/2006/06/6-common-errors-in-setting-java-heap.html

• 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.

Again thank you all.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic