Skip to content

Windows service installer fails with ES_JAVA_OPTS Heap Size Settings #23484

@isapir

Description

@isapir

Elasticsearch version: 5.2.2

Plugins installed: []

JVM version: 1.8u121

OS version: Windows 2008R2

Description of the problem including expected versus actual behavior:
Trying to set Java heap size via the Environment Variable ES_JAVA_OPTS fails with an error message "duplicate min heap size settings found"

The problem is that %ES_HOME%\config\jvm.options is read, including the -Xms and -Xmx options, and then ES_JAVA_OPTS is appended at the end, so you get another set of -Xms and -Xmx options, which then fails with the error above.

Steps to reproduce:

  1. SET ES_JAVA_OPTS=-Xms3g -Xmx3g
  2. call bin\elasticsearch-service.bat

Provide logs (if relevant): value of ES_JAVA_OPTS (notice 2g value at beginning and 3g value at end):

-Xms2g;-Xmx2g;-XX:+UseConcMarkSweepGC;-XX:CMSInitiatingOccupancyFraction=75;-XX:+UseCMSInitiatingOccupancyOnly;-XX:+DisableExplicitGC;-XX:+AlwaysPreTouch;-Xss1m;-Djava.awt.headless=true;-Dfile.encoding=UTF-8;-Djna.nosys=true;-Djdk.io.permissionsUseCanonicalPath=true;-Dio.netty.noUnsafe=true;-Dio.netty.noKeySetOptimization=true;-Dio.netty.recycler.maxCapacityPerThread=0;-Dlog4j.shutdownHookEnabled=false;-Dlog4j2.disable.jmx=true;-Dlog4j.skipJansi=true;-XX:+HeapDumpOnOutOfMemoryError;-Xms3g;-Xmx3g

duplicate min heap size settings found

Possibly related to #20899

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Delivery/PackagingRPM and deb packaging, tar and zip archives, shell and batch scriptsTeam:DeliveryMeta label for Delivery team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions