BigMemory 4.4.0 | Product Documentation | BigMemory Max Configuration Guide | Managing Data Life | How Configuration Affects Eviction in Distributed Cache
 
How Configuration Affects Eviction in Distributed Cache
Element eviction is a crucial part of keeping cluster resources operating efficiently. Element eviction and expiration are related, but an expired element is not necessarily evicted immediately and an evicted element is not necessarily an expired element. Cache elements might be evicted due to resource and configuration constraints, while expired elements are evicted from the Terracotta client when a get() or put() operation occurs on that element (sometimes called inline eviction).
The Terracotta server array contains the full key set (as well as all values), while clients contain a subset of keys and values based on elements they have faulted in from the server array.
Typically, an expired cache element is evicted, or more accurately flushed, from a client tier to a lower tier when a get() or put() operation occurs on that element. However, a client may also flush expired, and then unexpired elements, whenever a cache's sizing limit for a specific tier is reached or it is under memory pressure. This type of eviction is intended to meet configured and real memory constraints.
To learn about eviction and controlling the size of the cache, see Managing Data Life and Sizing Storage Tiers.
Flushing from clients does not mean eviction from the server array. Servers will evict expired elements and elements can become candidates for eviction from the server array when servers run low on allocated BigMemory. Unexpired elements can also be evicted if they meet the following criteria:
*They are in a cache with infinite TTI/TTL (Time To Idle and Time To Live), or no explicit settings for TTI/TTL. Enabling a cache's eternal flag overrides any finite TTI/TTL values that have been set.
*They are not resident on any Terracotta client. These elements can be said to have been "orphaned." Once evicted, they will have to be faulted back in from a system of record if requested by a client.
For more information about Terracotta Server Array data eviction, see "Automatic Resource Management" in the BigMemory Max Administrator Guide.