NetX runs within Apache Tomcat, and Tomcat in turn runs within Java (the Java Virtual Machine, or "JVM"). In order to tune memory setting for NetX, you do so via Tomcat — specifically with the CATALINA_OPTS environment variable. On Unix systems (Mac, Linux, et al), this is typically specified in Tomcat's setenv.sh file. This lives within the main Tomcat installation root, and within the "bin" sub-folder, eg:

/netx/bin/setenv.sh
CODE


The contents of this file look like this for a default installation:

#!/bin/sh
# ---------------------------------------------------------------------------------------
# Set JAVA_OPTS here
# ---------------------------------------------------------------------------------------
NETX_ID="netx"
export NETX_ID;
CATALINA_OPTS="$CATALINA_OPTS -Dexo=$NETX_ID -Xms2g -Xmx4g  -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:ParallelGCThreads=20 -XX:ConcGCThreads=5 -XX:InitiatingHeapOccupancyPercent=70 -XX:+HeapDumpOnOutOfMemoryError -Dlog.directory=$CATALINA_BASE/logs"
export CATALINA_OPTS;
CODE

Warning: please only change this if directed by NetX Support, or if you know what you are doing.

JVM settings

The following table describes the default JVM settings that ship with NetX:

SettingDefaultDescription
Dexo
netx
This is merely a process ID tag, used by NetX internally. Please do not adjust or remove this.
Xms
2g
This is the initial memory which Java will immediate expand to. Often, this can simply be set to the same value as Xmx.
Xmx
4g
This is the maximum memory which Java can ultimate use.
XX:+UseG1GC

This is only available if you are running Java 1.8, otherwise, please remove this variable.
XX:+HeapDumpOnOutOfMemoryError

This directs the JVM to dump its heap into a dump file if Tomcat every runs out of memory; this can be useful in determining why such an event occurred.

The only values you should ever really need to change are the heap memory sizes — Xms and Xmx. For many larger deployments, these values are as follows (roughly speaking)

Assets
Xms
Xmx
10,0002g4g
100,0004g8g
1,000,0008g
16g
10,000,00016g
32g


Windows

Changing these values on Windows requires you to use Tomcat's UI tool — and it must be done so manually — which is located here:

C:\Program Files\Netx\bin\netxw.exe
CODE

There, and on the "Java" tab, you will find inputs for "Initial memory pool" (which sets the "Xms"), and "Maximum memory pool" (which sets the "Xmx"). Additionally, there is an input textarea for "Java Options"; there you can input the following:

-XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:ParallelGCThreads=20 -XX:ConcGCThreads=5 -XX:InitiatingHeapOccupancyPercent=70 -XX:+HeapDumpOnOutOfMemoryError
CODE


Learning more

Tuning the JVM and Garbage Collector is considered by many to be of the "dark arts", so to speak. For more information please refer to these articles:

https://docs.oracle.com/cd/E40972_01/doc.70/e40973/cnf_jvmgc.htm