DataStax Help Center

DSE fails to start with "please set or unset MAX_HEAP_SIZE and HEAP_NEWSIZE in pairs"

Summary

DataStax Enterprise startup fails due to JVM settings in cassandra-env.sh.

Symptoms

When attempting to start DSE on a node, it fails to startup with a message relating to JVM heap configuration. For example:

please set or unset MAX_HEAP_SIZE and HEAP_NEWSIZE in pairs (see cassandra-env.sh)

Cause

Previously, the default garbage collector used for Cassandra was the Concurrent Mark Sweep (CMS) collector. In the cassandra-env.sh, it was necessary to set both MAX_HEAP_SIZE and HEAP_NEW_SIZE (JVM options -Xmx and -Xmn respectively).

In DSP-6392, the Garbage-First collector (G1GC) was enabled by default if Java 8 is installed from DSE 4.7.4 and 4.8.0 in line with the implementation of CASSANDRA-7486 in Cassandra 3.x. The CMS collector would still be used by default with Java 7.

However in order to achieve the latency target in G1GC (JVM option -XX:MaxGCPauseMillis), it is important to not set the young generation size HEAP_NEW_SIZE to allow G1 to automatically expand and reduce the young generation space as required (DSP_6860). But the current logic in the script enforces that both the max and new size variables be set in the following conditional test:

    if [ "x$MAX_HEAP_SIZE" = "x" ] ||  [ "x$HEAP_NEWSIZE" = "x" ]; then
        echo "please set or unset MAX_HEAP_SIZE and HEAP_NEWSIZE in pairs (see cassandra-env.sh)"
        exit 1
    fi

NOTE - Despite setting HEAP_NEW_SIZE, it will not be used with G1GC since the -Xmn JVM option is only used with CMS in the script.

Workaround

The issue is being addressed internal defect ID DSP-10033 and will be resolved in a future release of DataStax Enterprise.

In the meantime, simply set both the maximum and young generation sizes in cassandra-env.sh. For example:

MAX_HEAP_SIZE="16G"
HEAP_NEWSIZE="800M"

See also

Cassandra JIRA - CASSANDRA-7486

DataStax doc - DSE 4.8 Release notes

Java doc - Getting Started with the G1 Garbage Collector

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk