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:

  1. Open the Tomcat configuration tool. If you are running Windows, you will find it at Start ‣ All Programs ‣ Apache Tomcat ‣ Tomcat Configuration.

  2. Click Configure and select the Java tab.

  3. At the bottom of the Java Options field, enter the following lines:

    -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 9.0
    -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 9.0
    -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 9.0\temp
    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
    -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf\logging.properties
    -XX:SoftRefLRUPolicyMSPerMB=36000
    -XX:-UsePerfData
    -Dorg.geotools.referencing.forceXY=true
    

    Note -X java options are listed before -D system properties.

  4. If your application server is currently running, stop it and restart it.

Linux and macOS

Linux and macOS setenv.sh:

  1. 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 -X java options are listed before -D system properties.

    • Use of CATALINA_OPTS recommended (as used by Tomcat start and run command)