Version: 5.17
Configure the Native Memory Store
The Native Memory Store is a pluggable memory manager. It allows you to set up different configurations, or stores, for your application's data structures on a single JVM. These memory stores form part of a common access layer that scales up to use a configured amount of memory on the JVM.
As well as providing more predictable application scaling, using a Native Memory Store boosts performance, reduces latency, and minimizes garbage collection pauses.
Configure a Native Memory Store
Below are the configuration options for the Native Memory Store.
| Field | Description |
|---|---|
allocator | Specifies the mechanism for allocating memory; either STANDARD or POOLED. |
size | Size of the total native memory to allocate. |
min | Size of smallest block of memory to allocate. |
page | Size of the page in bytes to allocate as a block of memory. |
metadata | Percentage of the allocated native memory that is used for the metadata of other map components such as index (for predicates), offset, etc. |
Example configuration
The example configuration does the following:
- Creates a cluster with
Native Memoryand thePOOLEDallocator enabled. - Configures a map on the cluster to use native memory.
Example Hazelcast configuration
yaml
apiVersion: hazelcast.com/v1alpha1
kind: Hazelcast
metadata:
name: hazelcast
spec:
nativeMemory:
allocatorType: POOLED
size: 512M
Example Map configuration
yaml
apiVersion: hazelcast.com/v1alpha1
kind: Map
metadata:
name: map
spec:
hazelcastResourceName: hazelcast
inMemoryFormat: NATIVE
Example Cache configuration
yaml
apiVersion: hazelcast.com/v1alpha1
kind: Cache
metadata:
name: cache
spec:
hazelcastResourceName: hazelcast
inMemoryFormat: NATIVE