Skip to main content
1-Visitor
May 27, 2025
Question

How to resolve Cache issue - maxElementsInMemory

  • May 27, 2025
  • 1 reply
  • 478 views
I’ve installed Codebeamer 22.10 LTS inside a Docker container, but I’m encountering the following error:

Cache: oauth2StateCache has a maxElementsInMemory of 0. This might lead to performance degradation or OutOfMemoryError at Terracotta client. From Ehcache 2.0 onwards this has been changed to mean a store with no capacity limit. Set it to 1 if you want no elements cached in memory.
I attempted to resolve this by modifying the ehcache.xml file, which is located inside the JAR at:

/home/appuser/codebeamer/tomcat/webapps/ROOT/WEB-INF/lib/cb-22.10-LTS.jar
The original configuration was:


I replaced it with the following configuration:


However, the error persists. Additionally, any changes I make are lost when the container restarts, since the file resides inside a JAR.
Please help me how to reslove this issue. Thanks

1 reply

18-Opal
July 29, 2025
  1. Create a custom ehcache.xml on the host system with corrected config:

     
    <cache name="oauth2StateCache" maxElementsInMemory="1000" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="600" overflowToDisk="false" />
  2. Mount it into the container, e.g.:

     
    -v /opt/codebeamer/config/ehcache.xml:/home/appuser/codebeamer/conf/ehcache.xml
  3. Pass the path via Java system property:

     
    -Dnet.sf.ehcache.configurationResourceName=file:/home/appuser/codebeamer/conf/ehcache.xml
  4. Restart the container to apply changes.

This ensures the custom cache config is used persistently without modifying internal JAR files.

Thanks,