Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra:The stack size specified is too small, Specify at least 228k

I'm getting this error when starting cassandra after upgrade. Any idea?

# cassandra -f

xss =  -ea -javaagent:/usr/share/cassandra/lib/jamm-0.2.5.jar -XX:+UseThreadPriorities 
-XX:ThreadPriorityPolicy=42 -Xms1920M -Xmx1920M -Xmn200M -XX:+HeapDumpOnOutOfMemoryError -Xss180k

The stack size specified is too small, Specify at least 228k
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
like image 367
Harikrishnan Avatar asked Mar 18 '14 04:03

Harikrishnan


People also ask

Is stack size fixed in Java?

If we don't specify a size for the stacks, the JVM will create one with a default size. Usually, this default size depends on the operating system and computer architecture. For instance, these are some of the default sizes as of Java 14: Linux/x86 (64-bit): 1 MB.

How do you change the size of the stack in Java?

To increase the stack size, define the new value in the -Xss setting in the JAVA_OPTS entry in your Tomcat start script file (/opt/netiq/idm/apps/tomcat/bin/setenv.sh or C:\NetIQ\idm\apps\tomcat\bin\setenv. bat). For example, to set the stack size to 4M, change the setting to -Xss4M.

What is the default Java thread stack size?

Default Stack Size for JVM Internal Threads The default system stack size is 256 KB on all platforms. Note: The -Xss command line option sets the stack size of both application threads and JVM internal threads.

What is the maximum call stack size in Java?

The Java stack size is the size limit of each Java thread in the Java Virtual Machine (JVM) that runs the monitoring Model Repository Service. The default value is 512K.


1 Answers

I have fixed it by editing file /etc/cassandra/cassandra-env.sh

I have changed JVM_OPTS="$JVM_OPTS -Xss180k" to JVM_OPTS="$JVM_OPTS -Xss256k"

and it worked.

Basically the value of parameter Xss determines stack size. As the error indicates, It is too small. Just by increasing Xss will solve the problem. It was 180K before and I have increased to 256K. It can be different in different machines according to the size of database.

like image 75
Harikrishnan Avatar answered Sep 30 '22 06:09

Harikrishnan