The Background Cache Eviction Process Was Unable To Free

The Background Cache Eviction Process Was Unable To Free

這篇介紹關於The Background Cache Eviction Process Was Unable To Free。

Tomcat alert Error

1
2
3
4
5
6
7
8
9
10-Mar-2021 14:19:15.667 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] 
org.apache.catalina.webresources.Cache.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 [10,181] KB of data remained in the cache.

根據apache官方文件:
The maximum size of the static resource cache in kilobytes. If not specified, the default value is 10240 (10 megabytes).
This value may be changed while the web application is running (e.g. via JMX).
If the cache is using more memory than the new limit the cache will attempt to reduce in size over time to meet the new limit.
If necessary, cacheObjectMaxSize will be reduced to ensure that it is no larger than cacheMaxSize/20.

解決方法

1
2
$ vim /usr/local/tomcat/conf/context.xml
加上 <Resources cachingAllowed="true" cacheMaxSize="100000" />