Configuring 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 which 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.
Configuring a Native Memory Store
Below are the configuration options for the Native Memory Store.
Field | Description |
---|---|
|
Specifies the mechanism for allocating memory; either STANDARD or POOLED. |
|
Size of the total native memory to allocate. |
|
Size of smallest block of memory to allocate. |
|
Size of the page in bytes to allocate as a block of memory. |
|
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 Memory
and thePOOLED
allocator enabled. -
Configures a map on the cluster to use native memory.
apiVersion: hazelcast.com/v1alpha1
kind: Hazelcast
metadata:
name: hazelcast
spec:
nativeMemory:
allocatorType: POOLED
size: 512M
apiVersion: hazelcast.com/v1alpha1
kind: Map
metadata:
name: map
spec:
hazelcastResourceName: hazelcast
inMemoryFormat: NATIVE
apiVersion: hazelcast.com/v1alpha1
kind: Cache
metadata:
name: cache
spec:
hazelcastResourceName: hazelcast
inMemoryFormat: NATIVE