Configuring JVM Parameters
You can configure the JVM in the hazelcast
container using the jvm
field of the CRD spec.
Configuring a JVM Parameter
Use any of the following configuration options in the Hazelcast
resource. For more information, see the API Reference.
Field | Description |
---|---|
|
Configures the initial heap size of the Hazelcast process as a percentage of the total memory of a container. |
|
Sets the maximum heap size for a JVM running with a large amount of memory. |
|
Unlike its name, this parameter sets the maximum heap size for a JVM running with a small amount of memory. |
Example Configuration
The following Hazelcast
custom resource creates a cluster that uses all three parameters.
apiVersion: hazelcast.com/v1alpha1
kind: Hazelcast
metadata:
name: hazelcast
spec:
jvm:
memory:
initialRAMPercentage: "10"
maxRAMPercentage: "20"
minRAMPercentage: "10"
GC Parameters
Enabling Logging
To enable Garbage Collector Logging, you can use the following configuration:
apiVersion: hazelcast.com/v1alpha1
kind: Hazelcast
metadata:
name: hazelcast
spec:
jvm:
gc:
logging: enabled
It is going to set the following JVM argument: -verbose:gc
Setting the Garbage Collector
Before making Garbage Collector related changes using the Hazelcast Platform Operator, it is highly recommended to read Garbage Collector Considerations section of Capacity Planning Document to decide which Garbage Collector to use. |
To set the Garbage Collector, following configuration can be used:
apiVersion: hazelcast.com/v1alpha1
kind: Hazelcast
metadata:
name: hazelcast
spec:
jvm:
gc:
collector: <collector>
<collector>
can be replaced with the following options:
<collector> |
JVM Equivalent |
---|---|
|
|
|
|
|
|
Enabling IPv6 Stack
Hazelcast supports IPv6 addresses seamlessly, although IPv6 support is switched off by default. To enable IPv6 addressing in Hazelcast and set up a Hazelcast cluster on an IPv6-stack Kubernetes Cluster, you’ll need extra configurations. These configurations can be passed through JVM arguments. The provided example below shows how to create an IPv6 Hazelcast cluster using the Hazelcast Platform Operator.
apiVersion: hazelcast.com/v1alpha1
kind: Hazelcast
metadata:
name: hazelcast-ipv6
spec:
jvm:
args:
- "-Djava.net.preferIPv4Stack=false"
- "-Djava.net.preferIPv6Addresses=true"
- "-Dhazelcast.prefer.ipv4.stack=false"