Landon Kuhn Landon Kuhn - 1 year ago 249
Java Question

How to set JVM maximum heap memory for Apache Ignite v1.7?

How do I set the maximum heap memory available to Apache Ignite when running via
? The docs do not seem to cover this very basic task. Also, how do I verify that the setting is actually working?

I have read that the command line option
is available for passing JVM arguments from
to the JVM process, but am unable to find evidence it is actually working. For example, if I start Ignite as follows:

bin/ -v -J-Xmx2g

The program outputs the following message:

[09:13:42,422][INFO][main][IgniteKernal] VM arguments: [-Xms1g, -Xmx1g, -XX:+AggressiveOpts, -XX:MaxPermSize=256m, -DIGNITE_QUIET=false, -DIGNITE_SUCCESS_FILE=/Users/landon/Downloads/apache-ignite-fabric-1.7.0-bin/work/ignite_success_5d0c3958-8952-4a7d-81b0-76c07ae6c520,,,,, -DIGNITE_HOME=/Users/landon/Downloads/apache-ignite-fabric-1.7.0-bin, -DIGNITE_PROG_NAME=bin/, -Xmx2g]

Which seems to suggest both
are being passed.

ps aux
shows the following:

landon 47582 1.0 2.1 5214944 172616 s000 S+ 9:13AM 0:06.19 /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java -Xms1g -Xmx1g -server -XX:+AggressiveOpts -XX:MaxPermSize=256m -DIGNITE_QUIET=false -Xdock:name=Ignite Node -DIGNITE_SUCCESS_FILE=/Users/landon/Downloads/apache-ignite-fabric-1.7.0-bin/work/ignite_success_5d0c3958-8952-4a7d-81b0-76c07ae6c520 -DIGNITE_HOME=/Users/landon/Downloads/apache-ignite-fabric-1.7.0-bin -DIGNITE_PROG_NAME=bin/ -Xmx2g -cp /Users/landon/Downloads/apache-ignite-fabric-1.7.0-bin/libs/*:/Users/landon/Downloads/apache-ignite-fabric-1.7.0-bin/libs/ignite-indexing/*:/Users/landon/Downloads/apache-ignite-fabric-1.7.0-bin/libs/ignite-spring/*:/Users/landon/Downloads/apache-ignite-fabric-1.7.0-bin/libs/licenses/* org.apache.ignite.startup.cmdline.CommandLineStartup config/default-config.xml
landon 45624 0.0 0.0 3166752 1292 ?? S Fri07PM 0:00.01 /bin/bash bin/ -v -J-Xmx2g

Which ambiguously lists both
on the command line.

Answer Source

This is the correct way to set heap memory. If Xmx is listed twice, JVM will use the last one.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download