linux 下tomcat 的catalina.sh的JAVA_OPTS的配置

linux 下tomcat 的catalina.sh的JAVA_OPTS的配置

Please read this: OutOfMemory Error and make sure your application doesn’t have memory leak and excessive memory usage.

To change the settings, create a file named setenv.bat for windows or setenv.sh for Linux with entry as below:

Windows:

set JAVA_OPTS="-Xms256m -Xmx512m"

Linux:

export JAVA_OPTS="-Xms256m -Xmx512m"

Simply put this(setenv.bat/setenv.sh) file in %CATALINA_HOME%\bin\ folder. Your command file (catalina.bat/catalina.sh) already has a statement as below:

Windows:

  if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"

Linux:

  if [ -r "$CATALINA_BASE/bin/setenv.sh" ]; then
     . "$CATALINA_BASE/bin/setenv.sh"
  elif [ -r "$CATALINA_HOME/bin/setenv.sh" ]; then
     . "$CATALINA_HOME/bin/setenv.sh"
  fi

This will take care the rest.

你可能感兴趣的:(tomcat)