Infinispan Eviction Strategy

你。 提交于 2019-12-11 12:35:15

问题


I had eviction max-entries as 2000 and strategy as LRIS. But eviction started before reaching reaching the upper limit of 2000. So, my question is if there some kind of memory constraint here which caused this eviction strategy to work? If yes, how and where is it specified?

For now, i have changed eviction strategy to NONE.

Any help will be appreciated.


回答1:


Infinispan does not provide any memory-based eviction yet.

Infinispan uses a concurrent hash map that splits the hash space in segments (a.k.a. buckets) and each segment evicts it owns entries independently.

So, when you set the maxEntries=2000, internally, the concurrent hash map is creating segments with capacity maxEntries/numberSegments. When a segment is full, the eviction is trigger in that segment and removes an entry.

In your case, some segments are full quickly and before you reach the 2000 entries.

You can try the following:

  • increase the concurrency level (in <locking concurrencyLevel="yyy">, default 16). The number of segments increases with the concurrency level
  • try to implement a better hashCode() function to make a better spread of they keys.

Cheers.



来源:https://stackoverflow.com/questions/20263361/infinispan-eviction-strategy

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