Problems with: Soft Lock Cache Has Expired at the Basis of Ehcache

I get the following warning and I have no idea what to do about it. There are about 80,000 entries that write this warning to the catalina.out log file in tomcat every time bannedIPs are updated:

WARNING: Cache package.BannedIP Key package.BannedIP#73121 Lockable : null A soft-locked cache entry was expired by the underlying Ehcache. If this happens regularly you should consider increasing the cache timeouts and/or capacity limits Dec 16, 2010 10:00:53 PM net.sf.ehcache.hibernate.strategy.AbstractReadWriteEhcacheAccessStrategy handleLockExpiry 

Configuration for BannedIP in ehcache.xml:

  <cache name="package.BannedIP" maxElementsInMemory="80000" eternal="true" overflowToDisk="true" diskPersistent="true" /> 

Any help would be appreciated.

+3
source share
2 answers

Are you experiencing performance or usability issues as a result of this warning? If not, then it seems that you should treat this warning as such: a warning.

Otherwise, the solution seems to be to increase the size of maxElementsInMemory to account for the difference in what is cached versus what is actually used.

Hope this helps.

+3
source

You are not convinced that the .BannedIP package actually contains what you expect?

You can programmatically use statistics to find out what is going on. Given that you have a configuration bit, Ehcache should never fail (as long as you have less than 80k instances of BannedIP).

In addition, to understand what this means: you are in the process of updating BannedIP instances, but when the commit occurs, the SoftLock that Hibernate set to mark this entry is in the process of being updated, for some reason evicted ... Interestingly, Why are these updates taking so long?

Also, although I’m just thinking out loud, could it be some other process (mass update) that will invalidate the entire cache region?

+2
source

Source: https://habr.com/ru/post/885981/


All Articles