Support Questions

Find answers, ask questions, and share your expertise

Running NiFi -- Error with Heap Sizes

avatar
Explorer

I installed Nifi 1.3.0 and am trying to run it with "bin/nifi.sh run".

This is my first time trying to run it and it keeps giving me this: "Error occurred during initialization of VM. Incompatible minimum and maximum heap sizes are specified."

I edited the bootstrap config file to xmx32g, but the error is still the same.

I haven't seen any other questions asking about initialization issues; please let me know how I can resolve this. Thanks.

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Lucy Tan

The mentioned error, Can occur if you have specified the -Xms greater than the -Xmx value.

Error occurred during initialization of VM. Incompatible minimum and maximum heap sizes are specified

.

Please make sure that they are properly set. For example please check the below error, Here i am setting the Xmx (Maximum Heap) to a lower value than the -Xms (Initial Heap) So i get the error.

# java -Xmx1056M -Xms2056M -version
Issue:  Error occurred during initialization of VM. Incompatible minimum and maximum heap sizes specified

.

So please check the global settings .. if somewhere you have set incorrect values for these parameters which is taking precedence.

It also depends on the JVM architecture ... Like with 32 bit JVM you can not define much larger heap.. So also please check the output of the following command which will tell your JVM architecture and version

# java -version

.

View solution in original post

5 REPLIES 5

avatar
Master Mentor

@Lucy Tan

The mentioned error, Can occur if you have specified the -Xms greater than the -Xmx value.

Error occurred during initialization of VM. Incompatible minimum and maximum heap sizes are specified

.

Please make sure that they are properly set. For example please check the below error, Here i am setting the Xmx (Maximum Heap) to a lower value than the -Xms (Initial Heap) So i get the error.

# java -Xmx1056M -Xms2056M -version
Issue:  Error occurred during initialization of VM. Incompatible minimum and maximum heap sizes specified

.

So please check the global settings .. if somewhere you have set incorrect values for these parameters which is taking precedence.

It also depends on the JVM architecture ... Like with 32 bit JVM you can not define much larger heap.. So also please check the output of the following command which will tell your JVM architecture and version

# java -version

.

avatar
Explorer

I kept xms at the default (512m), and still have the same error. The setting is in conf/bootstrap.conf

avatar
Master Mentor

@Lucy Tan

Can you please check the following line of your "nifi.sh" if it has the correct value? Or may be you can echo the following line output to see what value is it taking actually and from where?

    run_nifi_cmd="'${JAVA}' -cp '${BOOTSTRAP_CLASSPATH}' -Xms12m -Xmx24m ${BOOTSTRAP_DIR_PARAMS} org.apache.nifi.bootstrap.RunNiFi $@"

- I am assuming that you might have removed any "-Xms12m -Xmx24m" such reference from inside your script.

Reference: https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nif...

.

avatar
Explorer

Thanks for your help, Jay. It turns out I just had to restart my computer! I had updated to Java 8 before, and didn't restart, so version 6 was giving me the issue.

avatar
Master Mentor

@Lucy Tan

Wow!!! good to know that the issue is resolved. It will be great to close this thread as the issue is resolved.