Tomcat部署flowable出现consider increasing the maximum size of the cache

文章描述了在部署flowable-6.5.0到ApacheTomcat8.5.32时遇到的警告,原因是静态资源缓存空间不足。解决办法是在context.xml中增大cacheMaxSize配置。
摘要由CSDN通过智能技术生成

使用Apache Tomcat/8.5.32部署运行flowable-6.5.0时发现控制台有警告

01-Apr-2024 20:55:08.877 警告 [localhost-startStop-1] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/WEB-INF/classes/static/bower_components/sass-bootstrap/examples/screenshots/offcanvas.jpg] to the cache for web application [/flowable-admin] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
01-Apr-2024 20:55:08.878 警告 [localhost-startStop-1] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/WEB-INF/classes/static/bower_components/sass-bootstrap/examples/screenshots/sticky-footer-navbar.jpg] to the cache for web application [/flowable-admin] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
01-Apr-2024 20:55:08.878 警告 [localhost-startStop-1] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/WEB-INF/classes/static/bower_components/sass-bootstrap/examples/screenshots/sticky-footer.jpg] to the cache for web application [/flowable-admin] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
01-Apr-2024 20:55:08.879 警告 [localhost-startStop-1] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/WEB-INF/classes/static/bower_components/sass-bootstrap/examples/screenshots/theme.jpg] to the cache for web application [/flowable-admin] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache

问题原因:

查询Tomcat官方资料https://tomcat.apache.org/tomcat-8.5-doc/config/resources.html之后发现
在这里插入图片描述
其中:

cacheMaxSize	
The maximum size of the static resource cache in kilobytes. If not specified, the default value is 10240 (10 MiB). 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.

翻译后的解释为:

缓存最大大小
静态资源缓存的最大大小(千字节)。如果未指定,默认值为10240(10兆字节)。该值可以在网络应用程序运行时更改(例如通过JMX)。如果缓存使用的内存超过新的限制,缓存将尝试逐渐减小大小以满足新的限制。如有必要,将减少cacheObjectMaxSize以确保其不大于cacheMaxSize/20。

可以得知是由于flowable本身中存在众多的配置、代码以及静态文件等等,然而静态资源的设置太小,不够使用,导致启动时console警告缓存不够。

解决方法:

在tomcat的conf文件夹下的context.xml配置文件中添加如下配置(配置为增加到102400千字节(100兆字节))

<Resources cachingAllowed="true" cacheMaxSize="102400" />

在这里插入图片描述
修改后保存重启,发现问题已经消失
在这里插入图片描述

  • 9
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值