Configuring Tomcat memory utilization
It’s also a good idea to configure Tomcat’s memory utilization.
Edit the file $TOMCAT_HOME/bin/setenv.sh and change the JAVA_OPTS parameter to increase the system memory managed by the JVM (Java Virtual Machine).
OpenJDK 11
Section titled “OpenJDK 11”These are the default configuration file values. Tomcat will reserve 4096 MB (Xmx parameter), and the heap size in Java 11 is dynamically assigned by the JVM. For this configuration, your server needs at least 5.5 GB of RAM (It is good practice to leave 1 GB of free RAM for the OS).
JAVA_OPTS="$JAVA_OPTS -Xms256m -Xmx4096m -XX:+UseConcMarkSweepGC"JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true -Dlog4j.configuration=file://$CATALINA_HOME/conf/log4j.properties"JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Dmail.mime.ignoreunknownencoding=true"CATALINA_PID=$CATALINA_HOME/catalina.pidexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CATALINA_HOME/lib/sigar