28

I am trying to start a server using jre 10.0.1 64 bit. There is an obvious change in the settings for the JVM in windows start batch files. With the setting of -XX:+UseParNewGC as the reference point of the error what would this need to be changed to in order to get a JVM server start with java 10 versus the java 8 settings I have shown?

The line of code causing the error reference is:

set JAVA_PARAMETERS=-XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:+CMSClassUnloadingEnabled -XX:ParallelGCThreads=2 -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10
Naman
  • 27,789
  • 26
  • 218
  • 353
Javacodeman113
  • 407
  • 1
  • 4
  • 11

5 Answers5

28

This collectors was deprecated in JDK 9 and removed in JDK 10.

https://bugs.openjdk.java.net/browse/JDK-8151084

The new default is the G1 collector and I suggest you see if that suits your needs.

Alan Bateman
  • 5,283
  • 1
  • 20
  • 25
Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
  • 5
    The flag was removed, but not the collector. ParNew is the default collector for young generation when CMS is selected. – apangin Apr 22 '18 at 10:13
20

As a follow up to Peter's answer the flag is

-XX:+UseG1GC

as described at Oracle

kometen
  • 6,536
  • 6
  • 41
  • 51
7

I was getting the same error in elasticsearch. So the best way to resolve it is.

Run

sudo nano /usr/share/elasticsearch/bin/elasticsearch.in.sh

and comment out that VM arg

#ES_GC_OPTS="$ES_GC_OPTS -XX:+UseParNewGC"
Sahil Rajput
  • 135
  • 1
  • 5
1

I was facing same issue by running below command it gets resolved

set JAVA_PARAMETERS=-XX:+UseG1GC

Shubham Shah
  • 99
  • 1
  • 1
  • 7
0

Use -XX:+UseConcMarkSweepGC if you do want to use CMS.

stackoverflowed
  • 686
  • 8
  • 22