• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to our Tomcat forum.
 
Saloon Keeper
Posts: 27808
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try using double-quotes instead of single quotes. That is:


 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic