UseConcMarkSweepGC error - cannot start ElasticSearch

I posted a question on Stack Overflow but perhaps it's better here.

https://stackoverflow.com/questions/69875937/elasticsearch-windows-2016-hosted-server-useconcmarksweepgc-error

I downloaded the Elasticsearch ZIP and extracted it to

c:\elastic\Elasticsearch-7.14.0

Each time I try to run Elasticsearch.bat , I get the error:

Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
output:

error:
Unrecognized VM option 'UseConcMarkSweepGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
        at org.elasticsearch.tools.launchers.JvmOption.flagsFinal(JvmOption.java:119)
        at org.elasticsearch.tools.launchers.JvmOption.findFinalOptions(JvmOption.java:81)
        at org.elasticsearch.tools.launchers.JvmErgonomics.choose(JvmErgonomics.java:38)
        at org.elasticsearch.tools.launchers.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:135)
        at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:86)

C:\elastic\Elasticsearch\Elasticsearch-7.14.0\config\jvm.options

has these lines:

## GC configuration
8-13:-XX:+UseConcMarkSweepGC
8-13:-XX:CMSInitiatingOccupancyFraction=75
8-13:-XX:+UseCMSInitiatingOccupancyOnly

## G1GC Configuration
# NOTE: G1 GC is only supported on JDK version 10 or later
# to use G1GC, uncomment the next two lines and update the version on the
# following three lines to your version of the JDK
10-13:-XX:-UseConcMarkSweepGC
10-13:-XX:-UseCMSInitiatingOccupancyOnly
14-:-XX:+UseG1GC

The two suggestions I've managed to find are:

  1. To override the jvm.options file by putting a copy into this folder:

C:\elastic\Elasticsearch\Elasticsearch-7.14.0\config\jvm.options.d

  1. Comment out the following lines in both files:-XX:+UseConcMarkSweepGC-XX:CMSInitiatingOccupancyFraction=75-XX:+UseCMSInitiatingOccupancyOnly

If I do this, I get the same error as though Elasticsearch is ignoring the jvm.options files.

I don't know much about Java. According to this file:

C:\elastic\Elasticsearch\Elasticsearch-7.14.0\jdk\release

the Java version is:

JAVA_VERSION="16.0.1"

That said, I followed the comments in the options file and also tried setting these lines to:

## G1GC Configuration
# NOTE: G1 GC is only supported on JDK version 10 or later
# to use G1GC, uncomment the next two lines and update the version on the
# following three lines to your version of the JDK
10-13:-XX:-UseConcMarkSweepGC
10-13:-XX:-UseCMSInitiatingOccupancyOnly
16-:-XX:+UseG1GC

Still no joy.

Can someone please help me?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.