Updating the $SPECROOT/tomcat/bin/catalina.sh and setting the JAVA_OPTS -Xmx parameter to define the maximum memory the server can use is not working as expected.
JAVA_OPTS="-DOneClick -server -Xmx4096M -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Djavax.net.ssl.trustStore=$SPECROOT/custom/keystore/cacerts -Dfile.encoding=UTF-8 -Dcom.sun.management.jmxremote -Dorg.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER=true"
We found that we MUST set the maximum memory size in OneClick's Administration - Web Server Memory page.
Release: Any version of Spectrum
Component: Spectrum OneClick
Check for a tomcat-server-config.xml file located in the $SPECROOT/custom/common/config directory on the OneClick system.
If this file is present and it contains a <memory> tag, then this will take precedence over the -Xmx entry in the $SPECROOT/tomcat/bin/catalina.sh file,
as it pertains to the view in the OneClick Admin GUI.
<?xml version="1.0" encoding="UTF-8"?>
<!--
-->
<!-- This file is a configuration file for tomcat server -->
<tomcat-server-config>
<catalina>$$tomcat_root</catalina>
<memory>1536</memory>
<charset>UTF-8</charset>
</tomcat-server-config>
Use the OneClick Administration -> Web Server Memory page to set/change the Web Server memory:
NOTE: As of Spectrum 10.4.x there is an intermittent issue where changing/editing the Web Server memory on OneClick Admin does not work correctly. The new value is updated in tomcat-server-config.xml and on the web page but the default is still being used from the $SPECROOT/tomcat/bin/catalina.sh. This will be obvious from the web page if OneClick memory usage % calculation is not correct. e.g. if we update the web page to use 16 GB and the memory usage on the same page says we are using 2 GB or 50% then it is still using the default total memory from catalina.sh.
You will want to double check the catalina.sh file and may have to manually set the -Xmx memory settings accordingly. Tomcat must be restarted for the edit/change of catalina.sh to take effect. This is still seen intermittently on new versions such as 21.2.12.