Setting the JAVA_OPTS and CLASSPATH environment variables¶
JAVA_OPTS parameters configure the Java virtual machine
CLASSPATH instructs the Java runtime environment to search additional directories for classes.
Both variables can be set by modifying the setenv script in the Tomcat bin directory.
tomcat\bin\setenv.bat
Important JAVA_OPTS Configuration Parameters¶
| Parameter | Purpose |
|---|---|
| -Xmx | Sets the maximum amount of memory that can be allocated to the Java heap. This should be a minimum of 16GB for production deployments and ideally about 75% of available memory on the machine. Setting too low may result in Java 'out of memory' errors. Example: -Xmx16g sets the maximum heap size to 16GB |
| -Xms | Sets the initial amount of memory to be allocated to the Java heap. When running in production, there may be a performance benefit to setting this to the same value as -Xmx which avoids the need to grow the heap as memory demand grows. Example: -Xms128msets the initial heap to 128MB |
| -D{system-property} | Sets a System Property as described in the System Properties reference. Example: -DRegistryProperties=file:///path/to/my/fmr.properties |