Caches, Regions, Expiry, Eviction

classic Classic list List threaded Threaded
3 messages Options
narges saleh narges saleh
Reply | Threaded
Open this post in threaded view
|

Caches, Regions, Expiry, Eviction

Hi All,

I need confirmation for my understanding of some basic concepts. 
These are my understanding. Please confirm.
1) Regions are not applicable to on heap caches. I'd use JVM -Xms and -Xmx to set the limits, while with off heap caches, I'd use regions  with initial/max size set.
2) When I define regions with persistence enabled, I'd define expiryPolicy, not evictionPolicy.
3) With on heap caches, I'd define the evictionPolicy directly applied to the cache.

thanks


ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: Caches, Regions, Expiry, Eviction

Hello!

1. There's no such thing as pure on-heap cache. On-heap is an extra option for a cache, which is always off-heap. So you need to set both.
2. Eviction policy is applicable to on-heap part of a cache only. Expiry policy will remove data from both off-heap and PDS. There's also page eviction which changes its meaning when you add persistence.
3. Yes, but it will not remove data from off-heap so it will still be in the cache.

Regards,
--
Ilya Kasnacheev


пн, 16 нояб. 2020 г. в 15:55, narges saleh <[hidden email]>:
Hi All,

I need confirmation for my understanding of some basic concepts. 
These are my understanding. Please confirm.
1) Regions are not applicable to on heap caches. I'd use JVM -Xms and -Xmx to set the limits, while with off heap caches, I'd use regions  with initial/max size set.
2) When I define regions with persistence enabled, I'd define expiryPolicy, not evictionPolicy.
3) With on heap caches, I'd define the evictionPolicy directly applied to the cache.

thanks


narges saleh narges saleh
Reply | Threaded
Open this post in threaded view
|

Re: Caches, Regions, Expiry, Eviction

Thanks Ilya, for the explanation.

So, to recap, 
data always resides in off heap, but it can be configured to reside to on heap as well.
You define eviction policy on regions to evict the data from on heap, but it won't affect the off heap.
You define expiry policy at cache level to remove data from off heap.

On Mon, Nov 16, 2020 at 7:04 AM Ilya Kasnacheev <[hidden email]> wrote:
Hello!

1. There's no such thing as pure on-heap cache. On-heap is an extra option for a cache, which is always off-heap. So you need to set both.
2. Eviction policy is applicable to on-heap part of a cache only. Expiry policy will remove data from both off-heap and PDS. There's also page eviction which changes its meaning when you add persistence.
3. Yes, but it will not remove data from off-heap so it will still be in the cache.

Regards,
--
Ilya Kasnacheev


пн, 16 нояб. 2020 г. в 15:55, narges saleh <[hidden email]>:
Hi All,

I need confirmation for my understanding of some basic concepts. 
These are my understanding. Please confirm.
1) Regions are not applicable to on heap caches. I'd use JVM -Xms and -Xmx to set the limits, while with off heap caches, I'd use regions  with initial/max size set.
2) When I define regions with persistence enabled, I'd define expiryPolicy, not evictionPolicy.
3) With on heap caches, I'd define the evictionPolicy directly applied to the cache.

thanks