On-Heap Caching
GridGain uses an off-heap memory to allocate memory regions outside of Java heap. However, you can enable on-heap caching by setting CacheConfiguration.setOnheapCacheEnabled(true)
.
On-heap caching is useful in scenarios when you do a lot of cache reads on server nodes that work with cache entries in binary form or invoke cache entries' deserialization. For instance, this might happen when a distributed computation or deployed service gets some data from caches for further processing.
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="myCache"/>
<property name="onheapCacheEnabled" value="true"/>
</bean>
CacheConfiguration cfg = new CacheConfiguration();
cfg.setName("myCache");
cfg.setOnheapCacheEnabled(true);
var cfg = new CacheConfiguration {
Name = "myCache",
OnheapCacheEnabled = true
};
Configuring Eviction Policy
Refer to the On-Heap Cache Eviction section for the instruction on how to configure eviction policy for on-heap caches.
© 2020 GridGain Systems, Inc. All Rights Reserved. Privacy Policy | Legal Notices. GridGain® is a registered trademark of GridGain Systems, Inc.
Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are either registered trademarks or trademarks of The Apache Software Foundation.