The /apache-tomcat/temp directory is filling up with numbered folders and eating filesystem/disk space.
What is creating these folders and can they safely be deleted?
Release : 12.3
Component : AWI / Tomcat
These folders and files are being created due to a difference in the Xms (initial) Java heap and Xmx (maximum) Java heap specifications.
In this particular instance, the initial heap was set to 2048M, but the maximum heap was set to 10240M.
export JAVA_HOME=/usr
export JAVA_OPTS="-Xms2048M -Xmx10240M"
export CATALINA_OPTS="-Xms2048M -Xmx10240M"
When these values are different, this causes recompiles to happen constantly. This action of recompiling creates these folders filled with files.
To resolve this, stop Tomcat, delete all of the folders in the /apache-tomcat/temp folder EXCEPT for the /ecc-plugins folder, change the Xms and Xmx Java heap settings values to be identical, such as:
export JAVA_HOME=/usr
export JAVA_OPTS="-Xms2048M -Xmx2048M"
export CATALINA_OPTS="-Xms2048M -Xmx2048M"
And restart Tomcat.
The above example showed that the max Java heap was set to 10G. There is almost never a reason for Tomcat to be using that much memory, but the biggest problem was the difference in the initial and maximum heap sizes. This in itself can cause performance issues because of the constant recompiling. If you feel that you require more than 2G for Tomcat, start with 4G (4096M), but increasing the memory up to 8G (8192M) is usually more than enough.