Configuring bootstrap JVM settings
Learn about Java memory calculations, defaults and how to override them with custom values.
Cloudera Flow Management - Kubernetes Operator calculates JVM memory setting Max Direct Memory Size, Min Heap Size (xms), and Max Heap Size (xmx) based on container memory limits or requests.
In bootstrap settings, java.arg.10
is
DirectMem, java.arg.2
is Min Heap, and
java.arg.3
is Max Heap.
Java memory is calculated and set in the following order:
-
- Based on memory of the NiFi resource
-
-
The minimum DirectMem allowed for NiFi is 512MB. DirectMem is set to the maximum value between 512MB and 10% of the memory limit. If you do not provide a memory limit, the same calculation is made on the memory request in the specifications.
-
Min Heap Size (xms) and Max Heap Size (xmx) is set to 75% of the memory limit subtracting the calculated DirectMem.
-
-
- Defaults
-
If you do not specify memory for the NiFi resource, the following default values are automatically set:
-
java.arg.2: -Xms2g
-
java.arg.3: -Xmx2g
-
java.arg.10: -XX:MaxDirectMemorySize=512m
-
Advanced configuration: Custom values to override inbuilt memory calculations
You can set each java argument for memory as part of NiFi specifications, under the
configOverride
key.
spec:
configOverride:
bootstrapConf:
upsert:
java.arg.2: -Xms2g
java.arg.3: -Xmx2g
java.arg.10: -XX:MaxDirectMemorySize=512m