diff --git a/CHANGES.txt b/CHANGES.txt index daae8395e0..30d111e04a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 4.0-alpha5 + * Fail startup if -Xmn is set when the G1 garbage collector is used (CASSANDRA-15839) * generateSplits method replaced the generateRandomTokens for ReplicationAwareTokenAllocator. (CASSANDRA-15877) * Several mbeans are not unregistered when dropping a keyspace and table (CASSANDRA-14888) * Update defaults for server and client TLS settings (CASSANDRA-15262) diff --git a/conf/cassandra-env.sh b/conf/cassandra-env.sh index 724498a4e9..10fbf31211 100644 --- a/conf/cassandra-env.sh +++ b/conf/cassandra-env.sh @@ -176,6 +176,13 @@ elif [ $DEFINED_XMN -ne 0 ] && [ $USING_CMS -eq 0 ]; then JVM_OPTS="$JVM_OPTS -Xmn${HEAP_NEWSIZE}" fi +# We fail to start if -Xmn is used with G1 GC is being used +# See comments for -Xmn in jvm-server.options +if [ $DEFINED_XMN -eq 0 ] && [ $USING_G1 -eq 0 ]; then + echo "It is not recommended to set -Xmn with the G1 garbage collector. See comments for -Xmn in jvm-server.options for details." + exit 1 +fi + if [ "$JVM_ARCH" = "64-Bit" ] && [ $USING_CMS -eq 0 ]; then JVM_OPTS="$JVM_OPTS -XX:+UseCondCardMark" fi