Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top