Hazelcast High-Density Memory Store, the successor to Hazelcast Elastic Memory, is Hazelcast's new enterprise grade backend storage solution. This solution is used with the Hazelcast JCache implementation.
By default, Hazelcast offers a production ready, low garbage collection (GC) pressure, storage backend. Serialized keys and values are still stored in the standard Java map, such as data structures on the heap. The data structures are stored in serialized form for the highest data compaction, and are still subject to Java Garbage Collection.
In Hazelcast Enterprise, the High-Density Memory Store is built around a pluggable memory manager which enables multiple memory stores. These memory stores are all accessible using a common access layer that scales up to Terabytes of main memory on a single JVM. At the same time, by further minimizing the GC pressure, High-Density Memory Store enables predictable application scaling and boosts performance and latency while minimizing pauses for Java Garbage Collection.
This foundation includes, but is not limited to, storing keys and values next to the heap in a native memory region.
Configuring Hi-Density Memory Store
To use Hi-Density memory storage, native memory usage must be enabled by programmatically or by XML file. Also, you can configure its size, memory allocator type, minimum block size, page size and metadata space percentage.
allocator type: Type of memory allocator. Valid values are:
Default value is POOLED.
1 << 22
= 4194304 Bytes, about 4 MB.Here is programmatic configuration sample:
MemorySize memorySize = new MemorySize(512, MemoryUnit.MEGABYTES);
NativeMemoryConfig nativeMemoryConfig =
new NativeMemoryConfig()
.setAllocatorType(NativeMemoryConfig.MemoryAllocatorType.POOLED)
.setSize(memorySize)
.setEnabled(true)
.setMinBlockSize(16)
.setPageSize(1 << 20);
Here is XML configuration sample:
<native-memory enabled="true" allocator-type="POOLED">
<size value="512" unit="MEGABYTES"/>
</native-memory>
RELATED INFORMATION
Please refer to the Hazelcast JCache chapter chapter for the details of Hazelcast JCache implementation. As mentioned, High-Density Memory Store is used with Hazelcast JCache implementation.