Tomcat 调节缓存与内存参数

本文针对Tomcat在运行过程中出现的内存不足及缓存空间不足的问题提供了详细的解决方案。对于内存不足的情况,可以通过修改setenv.sh或setclasspath.sh文件来调整JVM的初始化内存和最大内存;对于缓存空间不足的问题,则可以在context.xml配置文件中加入相应的资源配置。

Question

Bug1: Tomcat内存大小不足。

Bug2:

cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache

Solution

Bug1:
建议更改Tomcat的setenv.sh 或 setclasspath.sh,加入:
JAVA_OPTS='-Xms【初始化内存大小】 -Xmx【可以使用的最大内存】'

另外,可以看下JVM设置-内存-heap。简单的深入了解下JVM原理。

Bug2:
tomcat 中context.xml 配置文件的 <Context></Context>中加入
<Resources cachingAllowed="true" cacheMaxSize="100000" />

Reference

[1]. JVM设置-内存-heap
[2]. 解决to the cache because there was insufficient free space available after evict
[3]. tomcat部署jenkins启动报错:insufficient free space available after evicting expired cache entries-consider increasing the maximum size of the cache.
[4]. TOMCAT内存大小调整

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值