Out of memory error of tomcat on Debian 5.0 Lenny

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 -mx1024M "

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

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

/etc/init.d/tomcat start

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.