Set Java startup options¶
The Apache Tomcat application server is optimized for a high number of operations, each with a low amount of data exchanged. This default configuration is not optimal for GeoServer which works with much larger GeoSpatial data.
Follow these steps to set up your Java configuration in a much more efficient way than the one provided by the default startup parameters.
Java options:
| Java Option | Description |
|---|---|
-XX:SoftRefLRUPolicyMSPerMB=36000 |
Configure memory use to encourage sharing of coordinate reference systems between requests. |
-XX:-UsePerfData |
Improve performance by disabling external performance monitoring |
System properties:
| Parameters | Description |
|---|---|
-Dorg.geotools.referencing.forceXY=true |
Default to interpreting coordinate reference systems in easting/northing order for greater compatibility with web clients |
-Dorg.geotoools.render.lite.scale.unitCompensation=true |
When rendering be sure to account for scale when selecting the correct rules to draw |
Windows¶
Apache Tomcat Java Options:
-
Open the Tomcat configuration tool. If you are running Windows, you will find it at Start > All Programs > Apache Tomcat > Tomcat Configuration.
-
Click Configure and select the Java tab.
-
At the bottom of the Java Options field, enter the following lines:
-Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 11.0 -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 11.0 -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 11.0\temp -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 11.0\conf\logging.properties -XX:SoftRefLRUPolicyMSPerMB=36000 -XX:-UsePerfData -Dorg.geotools.referencing.forceXY=trueNote
-Xjava options are listed before-Dsystem properties. -
If your application server is currently running, stop it and restart it.
Linux and macOS¶
Linux and macOS setenv.sh:
-
Java options are managed in
setenv.sh:#!/bin/sh # Prepend JVM Options CATALINA_OPTS="-XX:SoftRefLRUPolicyMSPerMB=36000 -XX:-UsePerfData ${CATALINA_OPTS}" # Append system properties CATALINA_OPTS="${CATALINA_OPTS} -Dorg.geotools.referencing.forceXY=true"Notes:
- Note
-Xjava options are listed before-Dsystem properties. - Use of
CATALINA_OPTSrecommended (as used by Tomcatstartandruncommand)
- Note