Infinispan does not yet provide memory-based evictions.
Infinispan uses a parallel hash map, which splits the hash space into segments (aka buckets), and each segment issues its own entries independently.
So, when you set maxEntries=2000 , internally, a parallel hash map creates segments with a capacity of maxEntries/numberSegments . When a segment is full, shutting down is a trigger in that segment and deletes the record.
In your case, some segments fill up quickly and before reaching 2000 records.
You can try the following:
- increase the level of concurrency (in
<locking concurrencyLevel="yyy"> , by default 16). The number of segments increases with the level of concurrency - try to implement the best
hashCode() function to improve the distribution of these keys.
Greetings.
source share