Tomcat runs out of memory

Your rating: None Average: 4.5 (2 votes)

Concern:

The groupware, webmail or OXtender doesn't work any more at all. There might be some "500 Internal Server Errors" and both the tomcat and groupware/webmail logfile contains error messages like "OutOfMemory" or "cannot allocate memory" or "Servlet OutOfMemory Exception"

Reason:

The error appears because a standard Java VM (tomcat runs with such a VM) allocates only a standard value of memory. On some machines tomcat needs more memory because the OXtender for MS Outlook.

Solution:

To avoid that tomcat runs out of memory, the following line has to be added to the beginning of the file /usr/share/tomcat/bin/catalina.sh:

JAVA_OPTS=" -server -ms20M -mx512M "

This line allocates 20 MB on startup and as a maximum 512 MB - There can also be taken higher values; depends on the memory the hardware has.

The following line should also be added to the jk2.properties file within /etc/tomcat/base/ which avoids
triggering a memory leak within the current tomcat version of Novell.

request.registerRequests=false

Tomcat has to be stopped while editing this file. Afterwards tomcat can be started with the command

/etc/init.d/tomcat start

Open-Xchange | Impressum