I am using hazelcast-spring-3.1.xsd
. My hazelcast map configuration is given below.
<hz:map name="defaultMap"
backup-count="1"
max-size="5000"
max-size-policy = "PER_NODE"
eviction-percentage="50"
read-backup-data="true"
eviction-policy="LRU"
merge-policy=
"com.hazelcast.map.merge.LatestUpdateMapMergePolicy"
time-to-live-seconds="0"
>
I have given max-size = 5000
. I have 12000 records and defaultMap is loading 12000 records in it if i do insert into it. I am confused here ,how it can load more data than its actual size 5000. I am getting no exception in inserting 12000 data records.
And one more thing its eviction configuration is not working also. I want to evict my cache by 50 percent if it reaches its max-size limit.
Can any body help me? Its very urgent.What i am missing ?
You have max-size-policy = "PER_NODE"
setting which means maximum number of map entries in each Hazelcast instance, not the whole Hazelcast cluster (or the whole map).
In Hazelcast 2.x releases, the default value for max-size eviction policy was cluster_wide_map_size
. In 3.x releases, it is replaced with PER_NODE
.
There are other settings as well. For detailed map eviction settings and examples, you can check this out.