Home > OS >  How to fix the below Cassandara error in docker container
How to fix the below Cassandara error in docker container

Time:09-28

Picked up _JAVA_OPTIONS: -Xms128m -Xmx256m

[0.013s][warning][gc,ergo] NewSize was set larger than initial heap size, will use initial heap size.

[0.013s][warning][gc,ergo] MaxNewSize (409600k) is equal to or greater than the entire heap (262144k).  A new max generation size of 262080k will be used.

OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.

CMSRescanMultiple (32) must be less than or equal to ergonomic maximum (2) which is based on the maximum size of the old generation of the Java heap

CMSConcMarkMultiple (32) must be less than or equal to ergonomic maximum (2) which is based on the maximum size of the old generation of the Java heap

Error: Could not create the Java Virtual Machine.

Error: A fatal exception has occurred. Program will exit.

Picked up _JAVA_OPTIONS: -Xms128m -Xmx256m

OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.

[0.008s][warning][gc,ergo] NewSize was set larger than initial heap size, will use initial heap size.

[0.009s][warning][gc,ergo] MaxNewSize (409600k) is equal to or greater than the entire heap (262144k).  A new max generation size of 262080k will be used.

CMSRescanMultiple (32) must be less than or equal to ergonomic maximum (2) which is based on the maximum size of the old generation of the Java heap

CMSConcMarkMultiple (32) must be less than or equal to ergonomic maximum (2) which is based on the maximum size of the old generation of the Java heap

Error: Could not create the Java Virtual Machine.

Error: A fatal exception has occurred. Program will exit.

CodePudding user response:

It looks like you're using a custom image of Cassandra. If you're new to Cassandra, we recommend that you follow the steps in the Quick Start guide on the Apache Cassandra website which will pull the image from Docker hub.

It doesn't make sense to have a NewGen size of 400MB (409600k) when there is only 256MB allocated to the heap. We recommend setting min (-Xms) and max (-Xmx) heap to the same size so that the maximum is pre-allocated on startup. Also set NewGen to 50% of max heap.

Additionally, Java 9 is not supported. Only Java 8 is supported in Cassandra 3.11 and earlier releases. Experimental support for Java 11 was added in Cassandra 4.0 although we are hoping to drop the "experimental" tag soon and make it official for 4.x. The intention is to support Java 11 17 LTS for future Cassandra releases. Cheers!

CodePudding user response:

Agree with Erick! The quick fix here, is to use the latest patch of OpenJDK 8, and set Xmx & Xms to 1GB or 2GB, and then maybe keep Xmn @ 400MB.

  • Related