private static void fromJvmDotOptionsFile(File tmpDir, Map<String, String> res) {
// GC configuration
- res.put("-XX:CMSInitiatingOccupancyFraction=", "75");
- res.put("-XX:+UseCMSInitiatingOccupancyOnly", "");
+ res.put("-XX:+UseG1GC", "");
// (by default ES 6.6.1 uses variable ${ES_TMPDIR} which is replaced by start scripts. Since we start JAR file
// directly on windows, we specify absolute file as URL (to support space in path) instead
assertThat(esConfig.getHttpPort()).isEqualTo(9001);
assertThat(esConfig.getEsJvmOptions().getAll())
// enforced values
+ .contains("-XX:+UseG1GC")
.contains("-Dfile.encoding=UTF-8")
// default settings
.contains("-Xms512m", "-Xmx512m", "-XX:+HeapDumpOnOutOfMemoryError");
assertThat(esConfig.getHttpPort()).isEqualTo(9001);
assertThat(esConfig.getEsJvmOptions().getAll())
// enforced values
+ .contains("-XX:+UseG1GC")
.contains("-Dfile.encoding=UTF-8")
// default settings
.contains("-Xms512m", "-Xmx512m", "-XX:+HeapDumpOnOutOfMemoryError");
assertThat(esConfig.getHttpPort()).isEqualTo(1234);
assertThat(esConfig.getEsJvmOptions().getAll())
// enforced values
+ .contains("-XX:+UseG1GC")
.contains("-Dfile.encoding=UTF-8")
.contains("-Djava.io.tmpdir=" + tempDir.getAbsolutePath())
// user settings
assertThat(underTest.getAll())
.containsExactly(
- "-XX:CMSInitiatingOccupancyFraction=75",
- "-XX:+UseCMSInitiatingOccupancyOnly",
+ "-XX:+UseG1GC",
"-Djava.io.tmpdir=" + tmpDir.getAbsolutePath(),
"-XX:ErrorFile=../logs/es_hs_err_pid%p.log",
"-Des.networkaddress.cache.ttl=60",
"\n" +
"# DO NOT EDIT THIS FILE\n" +
"\n" +
- "-XX:CMSInitiatingOccupancyFraction=75\n" +
- "-XX:+UseCMSInitiatingOccupancyOnly\n" +
+ "-XX:+UseG1GC\n" +
"-Djava.io.tmpdir=" + tmpDir.getAbsolutePath() + "\n" +
"-XX:ErrorFile=../logs/es_hs_err_pid%p.log\n" +
"-Des.networkaddress.cache.ttl=60\n" +