Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set JAVA_OPTS for Tomcat in Windows?

I'm trying to set JAVA_OPTS for Tomcat on a Windows machine, but I keep getting an error if I add more than one variable.

For example, this works:

set JAVA_OPTS="-Xms512M" 

But this does not:

set JAVA_OPTS="-Xms512M -Xmx1024M" 

It results in the error:

Invalid initial heap size: -Xms512M -Xmx1024M Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. 

It's as if I can set one variable (-Xmx will also work) but not several.

I'm using the instructed setenv.bat file and my Tomcat is 7.0.35.

like image 772
wannabeartist Avatar asked Feb 06 '13 14:02

wannabeartist


People also ask

What is the maximum heap size for Tomcat?

The Tomcat server is run within a Java Virtual Machine (JVM). This JVM that controls the amount of memory available to LabKey Server. LabKey recommends that the Tomcat web application be configured to have a maximum Java Heap size of at least 2GB for a test server, and at least 4GB for a production server.

How do I open Tomcat configuration utility?

Open the Start Menu and choose "Run". Enter "MSCONFIG" and hit Enter to open the System Configuration utility.


1 Answers

Apparently the correct form is without the ""

As in

set JAVA_OPTS=-Xms512M -Xmx1024M 
like image 56
wannabeartist Avatar answered Sep 19 '22 15:09

wannabeartist