控制台提示缓存不够,consider increasing the maximum size of the cache

编程知识 更新时间:2023-05-02 05:32:54

 consider increasing the maximum size of the cache

解决办法在tomcat下面的conf/conext.xml中加入如下配置

<!-- 设置最大缓存量 -->默认的是: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.

详情:http://tomcat.apache/tomcat-8.0-doc/config/resources.html

tomcat--》conf--》context.xml文件——》在resource标签中加上


<Context>
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
    <Resources cachingAllowed="true" cacheMaxSize="100000" />
</Context>

切记:由于本地运行eclipse有工作空间workspace,需要把工作空间里面的context.xml修改下。服务器没有工作空间。

最近的项目需要修改 context.xml 文件,可是每次重启Tomcat,context 文件又还原了。

例如环境如下:

Tomcat 安装路径:D:\apache\apache-tomcat-7.0.56\

Eclipse工作空间:D:\Develop\workspace\

相关项目:TestProject

需要的操作:

1. 在Eclipse工作空间server 目录下查找tomcat 下面的context.xml 。我的路径是D:\Develop\workspace\Servers\Tomcat v7.0 Server at localhost-config 。下面有 context.xml,修改此文件

2. 删除Tomcat 目录下server中catalina的相关项目。我的路径是D:\apache\apache-tomcat-7.0.56\work\Catalina\localhost\ 。将TestProject删除即可。

下次重启Tomcat 时,此项目就使用新的context.xml 文件了。
 

更多推荐

控制台提示缓存不够,consider increasing the maximum size of the cache

本文发布于:2023-04-26 07:04:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/d17631ac733588bd93ffcadf9124e7b3.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控制台   缓存   提示   increasing   size

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 104627文章数
  • 26216阅读数
  • 0评论数