Apache /temp is filling up with folders and eating filesystem/disk space
search cancel

Apache /temp is filling up with folders and eating filesystem/disk space

book

Article ID: 236651

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine CA Automic One Automation

Issue/Introduction

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?

Environment

Release : 12.3

Component : AWI / Tomcat

Cause

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. 

Resolution

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.

Additional Information

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.