参考文档:https://www.cnblogs.com/wdpnodecodes/p/8036333.html

1、因为服务器的内存占用超过90%,使用修改tomcat内存。

 修改tomcat下bin/catalina.bat文件

vi catalina.sh

 

 

 2、新建setenv.sh

下面是setenv.sh的内容

export CATALINA_OPTS="$CATALINA_OPTS -Xms6G  -Xmx6G   -XX:MaxDirectMemorySize=2G  -Dfineio.read_mem_limit=2   -Dfineio.write_mem_limit=1   -Dfineio.cache_mem_limit=1  -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/fr/logs/heapdump.hprof  "

后面的路径要记得改掉

 

 3、重新开启tomcat