tomcat配置緩存溢出異常

tomcat服務器後臺容易報錯,報緩存溢出

報錯信息:

[ContainerBackgroundProcessor[StandardEr»gine[Catalina]]] org.apache.catalina.webresourcesXache.backgroundProcess The background cache eviction process was unable to free [10] percent of the cache for Context [] - consider increasing the maximum size of the cache. After eviction approximately 110,228] KB of data remained in the cache。

報錯信息大致的意思就是不能給資源加cache了,因爲沒有足夠的可用空間了。

原因:

原來 tomcat8中增加了靜態資源緩存的配置 .cacheMaxSize:靜態資源緩存最大值,以KB爲單位,默認值爲10240KB .cachingAllowed:是否允許靜態資源緩存,默認爲true

對應兩個參數,解決方法有兩種:
1:考慮增加cache的最大大小 
2:關閉緩存

設置配置(位置:conf/context.xml):

在<Context>鍵值對中配置

<Resources
     cachingAllowed="false"
     cacheMaxSize="0"
    />

如圖:

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章