Tomcat8内存优化

2019-07-26  本文已影响0人  朱穆朗玛

Step-1

Download Apache Tomcat.

Step-2

Go to Apache Tomcat /bin directory.

Step-3

By default you wont see setenv.sh (for [Linux/Mac](https://crunchify.com/category/mac/)) or setenv.bat (for windows) file under /bin directory. You have to create one with below parameters.

export CATALINA_OPTS="$CATALINA_OPTS -Xms512m"
export CATALINA_OPTS="$CATALINA_OPTS -Xmx8192m"
export CATALINA_OPTS="$CATALINA_OPTS -XX:MaxPermSize=256m"

Step-4

  1. Go to command prompt.
  2. Go to <Tomcat Directory>/bin directory
  3. Execute command: ./catalina.sh run

Step-5

Monitor logfile and you should see your Tomcat started with all your specified parameters in setenv.sh file.

Command for Windows Environment:

You need to create setenv.bat file with below content:

set  "JAVA_OPTS=%JAVA_OPTS% -Xms512m -Xmx8192m-XX:MaxPermSize=256m -server"

and run Tomcat with catalina.bat

引用:https://crunchify.com/how-to-change-jvm-heap-setting-xms-xmx-of-tomcat/

上一篇 下一篇

猜你喜欢

热点阅读