解决tomcat内存溢出问题

在catalina.bat第一行设置
set JAVA_OPTS=-Xms256m -Xmx512m -XX:MaxPermSize=256m

如果是myeclipse启动,则在配置java的DefaultVM Arguments中配置:
-Xms128M -Xmx512M -XX:PermSize=64M -XX:MaxPermSize=128M

在catalina.sh中
# ----- Execute The Requested Command -----------------------------------------

# Bugzilla 37848: only output this if we have a TTY
if [ $have_tty -eq 1 ]; then
JAVA_OPTS="$JAVA_OPTS -server -Xms128M -Xmx512M -XX:PermSize=64M -XX:MaxPermSize=128M" echo "Using CATALINA_BASE:   $CATALINA_BASE"
  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"
  if [ ! -z "$CATALINA_PID" ]; then
    echo "Using CATALINA_PID:    $CATALINA_PID"
  fi
fi

你可能感兴趣的:(tomcat)