Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Tomcat 7 on FreeBSD. I manually start it from


by executing

./tomcat7 onestart

I need to increase the heap size for one application which runs in Tomcat. I added

export JAVA_OPTS="-Xmx3000m"



but that has no effect. Deployment always fails with an out of memory exception. I edited but that also has no effect. For Tomcat 6 on Ubuntu 10.04 these settings worked.

What am I doing wrong?

share|improve this question
up vote 0 down vote accepted

Try looking in /usr/local/etc/rc.d/tomcat7. There is probably an option to set the heap size there that is passed directly to Java.

This is an example of my Tomcat init script which I just copied from $TOMCAT/bin/ It won't look exactly like yours as I've modified it heavily, but it should give you an idea of what you can do.

"-  Djava.util.logging.config.file="$CATALINA_HOME/conf/"

case "$1" in
    # Start Tomcat
    $DAEMON_HOME/bin/jsvc \
    -Xms1024M -Xmx1024M \
    $JAVA_OPTS \
    -user $TOMCAT_USER \
    -home $JAVA_HOME \
    -Dcatalina.home=$CATALINA_HOME \
    -Dcatalina.base=$CATALINA_BASE \$TMP_DIR \
share|improve this answer
There seems to be no in my $TOMCAT/bin. I experimented a little: if I manually start $TOMCAT/bin/ heap settings from are applied as I expected. – Florian Apr 20 '12 at 8:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.