Support Questions

Find answers, ask questions, and share your expertise
Announcements
Now Live: Explore expert insights and technical deep dives on the new Cloudera Community BlogsRead the Announcement

jvm settings from bootstrap.conf vs from outside

avatar
Expert Contributor

For nifi, we have jvm options in bootstrap.conf:

java.arg.2=-Xms512m
java.arg.3=-Xmx512m

Then we also have env variables(got to know on google search,not from official documentation) that can be set from outside(like from kubernetes config yaml):

NIFI_JVM_HEAP_INIT
NIFI_JVM_HEAP_MAX

What's the connection between these 2 sets of properties?

1 REPLY 1

avatar
Super Collaborator

java.arg.2 and java.arg.3 in bootstrap.conf: These are the traditional way of setting JVM arguments within the NiFi configuration file itself. They translate to:

java.arg.2=-Xms512m: This sets the initial heap size of the NiFi JVM to 512 megabytes (m).
java.arg.3=-Xmx512m: This sets the maximum heap size of the NiFi JVM to 512 megabytes (m).
NIFI_JVM_HEAP_INIT and NIFI_JVM_HEAP_MAX environment variables: These are environment variables that allow you to configure the JVM heap size externally. This is particularly useful when deploying NiFi in containerized environments

If both java.arg.2 / java.arg.3 and NIFI_JVM_HEAP_INIT / NIFI_JVM_HEAP_MAX are defined, the environment variables take precedence. This means the values set in the environment variables will be used to configure the JVM heap size.

@manishg