Skip to main content
Version: 5.20

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.

FieldDescription
allocatorTypeSpecifies the mechanism for allocating memory; either STANDARD or POOLED.
sizeSize of the total native memory to allocate.
minBlockSizeSize of smallest block of memory to allocate.
pageSizeSize of the page in bytes to allocate as a block of memory.
metadataSpacePercentagePercentage 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 Memory and the POOLED allocator 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