Configuring Tomcat memory utilization
It's also a good idea to configure the Tomcat memory utilization.
Edit the file $TOMCAT_HOME/bin/setenv.sh and edit the parameter JAVA_OPTS, where you can increase the system memory managed by the JVM (Java Virtual Machine).
OpenJDK 11
These are the default configuration file values. The Tomcat will reserve 4096MB ( Xmx parameter ), and the size of the heap from version 11 is dynamically assigned by JVM. For this configuration, your server needs at least >=5.5GB of RAM (It is a good practice to always get 1GB 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.pid
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CATALINA_HOME/lib/sigar