Error when starting Cassandra prevents launching

Mahesh Muni picture Mahesh Muni · May 30, 2013 · Viewed 8.3k times · Source

I am trying to run Cassandra. But, I am getting this error:

[root@SudeepMangu bin]# ./cassandra -f
xss =  -ea -javaagent:/home/sudeep/apache-cassandra-1.2.5-src/lib/jamm-0.2.5.jar-
XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms930M -Xmx930M -Xmn200M -
XX:+HeapDumpOnOutOfMemoryError -Xss160k

Error occurred during initialization of VM Could not reserve enough space for object heap

I have tried setting JAVA_OPTS to max size with no effect.

Answer

grkvlt picture grkvlt · Jul 9, 2013

See my answer here, https://stackoverflow.com/a/14447535/92463 which describes increasing the stack segment size. Edit the conf/cassandra-env.sh configuration script, at around line 185, and change the -Xss180k to a higher value.

if [ "`uname`" = "Linux" ] ; then
  # reduce the per-thread stack size to minimize the impact of Thrift
  # thread-per-client.  (Best practice is for client connections to
  # be pooled anyway.) Only do so on Linux where it is known to be
  # supported.
  # u34 and greater need 180k
  JVM_OPTS="$JVM_OPTS -Xss180k"
fi
echo "xss = $JVM_OPTS"

I suggest testing values starting from -Xss200k and increasing in 20k increments. I have found that using -Xss280k on Ubuntu servers worked successfully.