Tomcat8内存优化

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/

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。