美文网首页
Tomcat8内存优化

Tomcat8内存优化

作者: 朱穆朗玛 | 来源:发表于2019-07-26 16:36 被阅读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/

相关文章

网友评论

      本文标题:Tomcat8内存优化

      本文链接:https://www.haomeiwen.com/subject/jdsdrctx.html