解决linux中tomcat内存溢出方法

 

在catalina.sh中加上:

 

 

# Bugzilla 37848: only output this if we have a TTY

if [ $have_tty -eq 1 ]; then

  echo "Using CATALINA_BASE:   $CATALINA_BASE"

   JAVA_OPTS="-server -Xms512m -Xmx1024m -XX:PermSize=128M -XX:MaxNewSize=256m -XX:MaxPermSize=384m -Djava.awt.headless=true " 

  echo "Using CATALINA_HOME:   $CATALINA_HOME"

  echo "Using CATALINA_TMPDIR: $CATALINA_TMPDIR"

  if [ "$1" = "debug" ] ; then

    echo "Using JAVA_HOME:       $JAVA_HOME"

  else

    echo "Using JRE_HOME:        $JRE_HOME"

  fi

  echo "Using CLASSPATH:       $CLASSPATH"

fi

你可能感兴趣的:(java,tomcat,linux)