Using a default Debian Tomcat 8 installation and the Xwiki Debian packages, catalina.log is spammed with massages like this during Xwiki startup:
org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/WEB-INF/classes/logback.xml] to the cache for web application [/xwiki] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
I tried playing with <Resources cachingAllowed="true" cacheMaxSize="100000" />
in /etc/tomcat8/Catalina/localhost/xwiki.xml
but this causes Xwiki not to start up at all any more.
Unfortunately, I was not able to find specific Xwiki documentation or help concerning this problem - any hints how to solve it?
Thanks and regards,
Gunter
Hi, I’ve also noticed this. I don’t think it’s a problem. AFAIK it’s because XWiki has a lot of webapp resources and they’re loaded at startup thus filling the cache quickly. So for me it just means that Tomcat will start slightly less fast than it could.
It would be great if we could tune Tomcat to have a higher cache value. I haven’t looked into this yet though.
Would you mind creating a jira issue for this?
The problem is back for Tomcat 9 and Ubuntu 18.04.4
https://jira.xwiki.org/browse/XWIKI-17208
The fix is trivial for anyone who comes across this at a later time - edit your /etc/xwiki/xwiki-tomcat9.xml file and change your values of cacheMaxSize=“(X)” cacheObjectMaxSize=“(X/20)” where X is a number bigger than the one currently configured, to something larger.
This was reported as Loading... already but did not include any modification of cacheObjectMaxSize, are you sure it’s required ?
According to the tomcat documentation, it is not required. It is automatically set to cacheMaxSize/20 if it is unspecified. I was just being pendantic when I was editing the configuration file.
So maybe we should just get rid of it since it does not really seems to be something that should be set at all most of the time.
https://tomcat.apache.org/tomcat-9.0-doc/config/resources.html
According to the documentation:
cacheObjectMaxSize
Maximum size of the static resource that will be placed in the cache. If not specified, the default value is 512
(512 kilobytes). If this value is greater than cacheMaxSize/20
it will be reduced to cacheMaxSize/20
. This value may be changed while the web application is running (e.g. via JMX).
I misread that. I thought that it would increase the size, but it’ll just leave it as 512K which is probably large enough for most circumstances.
So the conclusion is still the same - only the cacheMaxSize needs to be specified and increased.