Infinispan data eviction

為{幸葍}努か 提交于 2019-12-11 10:35:46

问题


I use infinispan cache version 5.1.6.FINA. I have configured named cache:

<namedCache name="cacheName">
    <locking lockAcquisitionTimeout="5000" />
    <eviction maxEntries="10" strategy="NONE" />
    <expiration lifespan="-1" maxIdle="-1" />
</namedCache>

I use it to store some data in memory only. I use this configuration during creating cache where key is Long and value is String and hold there only 4 elements always only 4. For this purpose I have hardcoded 4 keys: 1L, 2L, 3L, 4L and sometimes just change values of those elements.

If cache holds 2 elements with key 1L and 2L and some values and I try to add other two with his values, they replays each other. So as a result cache holds just 3 element with keys 1L, 2L, 3L or 1L, 2L, 4L. I've tried to change eviction strategy but is doesn't help. Additionally I can say that it is local environment, non clustering.

Could someone to explain me this behavior?


回答1:


If you have maxEntries=10, I'd expect you would have ±8 entries in the cache, not just 3. But generally, the answer is here:

  • Cache’s number of entries never reaches configured maxEntries, why is that?
  • Advanced Eviction Internals (also described here)


来源:https://stackoverflow.com/questions/24185830/infinispan-data-eviction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!