HazelCast Eviction policy - NONE

400 views
Skip to first unread message

Milind

unread,
May 3, 2016, 2:13:04 PM5/3/16
to Hazelcast
Hello All,

I am a newbie to Hazelcast and evaluating it for one of our projects. I would like to  confirm about eviction policy. We are planning to load a distributed map instance at start up and never expire the entries in it. Map is configured with eviction policy "NONE", "time-to-live=0", "max-idle-seconds=0".  Our application code keeps the cache in sync when ever there is an update/insert/delete on the database. 

Questions - 
1. Documentation says the entries will never expire when eviction policy is set to NONE. But what happens if a node is running low on heap and at runtime the application code is trying to add new entries to map ? Or if something else is causing high heap usage.  Would the Hazelcast evict any entries from this map to free up heap? 

2. Would the node throw out of memory exception and exit the cluster? 

Thanks
Milind

Ahmet Mircik

unread,
May 6, 2016, 10:47:39 AM5/6/16
to Hazelcast
Hi Milind,

Eviction and expiration are two different concepts. Eviction is used to free memory by evicting entries. Expiration is the end of life of an entry according to ttl or max-idle-seconds. Even eviction policy is NONE, expiration will work, they are independent. 

In your case, if you don't want to go OOM, you should define an eviction-policy. Relying on expiration to prevent OOME is not an appropriate way. 

--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/a520a038-3276-4166-8d02-fec23c3e994a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Milind

unread,
May 13, 2016, 2:02:27 PM5/13/16
to Hazelcast
Hi Ahmet,

Thanks for clarifying. So if I understand, If eviction is set to NONE and a map is configured not to expire its entries, then the entries will remain as long as they are not manually removed from map. If for any reasons, a node runs low on memory then it would throw OOME and exit the cluster. Right?

Thanks
Milind

Ahmet Mircik

unread,
May 13, 2016, 2:06:48 PM5/13/16
to Hazelcast
Reply all
Reply to author
Forward
0 new messages