1. 程式人生 > >Tomcat 調節快取與記憶體引數

Tomcat 調節快取與記憶體引數

Tomcat 調節快取與記憶體引數

2018年03月27日 21:12:33 在風中的意志 閱讀數:280

版權宣告:歡迎轉載,轉載請說明出處https://csdn.yanxml.com。大資料Github專案地址https://github.com/SeanYanxml/bigdata。 https://blog.csdn.net/u010416101/article/details/79719405

Question

Bug1: Tomcat記憶體大小不足。

Bug2:

cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
  • 1

Solution

Bug1:
建議更改Tomcat的setenv.sh 或 setclasspath.sh,加入:
JAVA_OPTS='-Xms【初始化記憶體大小】 -Xmx【可以使用的最大記憶體】'
  • 1
  • 2
  • 3

另外,可以看下JVM設定-記憶體-heap。簡單的深入瞭解下JVM原理。

Bug2:
tomcat 中context.xml 配置檔案的 <Context></Context>中加入
<Resources cachingAllowed="true" cacheMaxSize="100000" />