Local Cache Policy

The local cache is used as a client-side cache that stores objects read from the SpaceClosed Where GigaSpaces data is stored. It is the logical cache that holds data objects in memory and might also hold them in layered in tiering. Data is hosted from multiple SoRs, consolidated as a unified data model. by the client application. Holding the objects in the local cache speeds up repeated read operations of the same data. The readById/readByIds operation has a special optimization with a local cache that speeds up the retrieval time of the object from the local cache, if the object is already stored there. The local cache evicts objects when a threshold is met. For client applications with a large heap size, you may want to configure the local cache eviction parameters as follows in order to control the eviction behavior:

<os-core:space-proxy id="space" space-name="mySpace" />

<os-core:local-cache id="localCacheSpace" space="space" update-mode="PULL" >
            <prop key="space-config.engine.cache_size">5000000</prop>
            <prop key="space-config.engine.memory_usage.high_watermark_percentage">75</prop>
            <prop key="space-config.engine.memory_usage.write_only_block_percentage">73</prop>
            <prop key="space-config.engine.memory_usage.write_only_check_percentage">71</prop>
            <prop key="space-config.engine.memory_usage.low_watermark_percentage">45</prop>
            <prop key=" space-config.engine.memory_usage.eviction_batch_size">1000</prop>
            <prop key="space-config.engine.memory_usage.retry_yield_time">100</prop>
            <prop key="space-config.engine.memory_usage.retry_count">20</prop>
<os-core:giga-space id="gigaSpace" space="localCacheSpace"/>

With the above parameters:

The space-config.engine.cache_size property is set to a large value. This causes the local cache to evict data based on the available free memory, and not based on the total number of objects within the local cache.