版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/CoderTnT/article/details/88027051
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"
/>
如图: