# Duplicate Xms and Xms values for Elasticsearch with Docker

**URL:** <https://discuss.elastic.co/t/duplicate-xms-and-xms-values-for-elasticsearch-with-docker/149590>\
**Category:** Elasticsearch\
**Created:** [September 23, 2018, 12:38pm UTC](https://discuss.elastic.co/t/duplicate-xms-and-xms-values-for-elasticsearch-with-docker/149590 "2018-09-23T12:38:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hari\_Prasad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hari_prasad/32/56784_2.png) [@Hari\_Prasad](https://discuss.elastic.co/u/Hari_Prasad)\
**Post date:** [September 23, 2018, 12:38pm UTC](https://discuss.elastic.co/t/duplicate-xms-and-xms-values-for-elasticsearch-with-docker/149590/1 "2018-09-23T12:38:20Z")

</div>

I have setup the ELK stack with Docker and I am using the 6.4.0 version of the same, with Docker version 18.06.0-ce, build 0ffa825.

The docker compose file for the Elasticsearch is

```
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION}
volumes:
  - "./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro"
  - "./esdata:/usr/share/elasticsearch/data"
ports:
  - "${ELASTICSEARCH_HTTP_PORT}:${ELASTICSEARCH_HTTP_PORT}"
  - "${ELASTICSEARCH_TCP_PORT}:${ELASTICSEARCH_TCP_PORT}"
environment:
  ES_JAVA_OPTS: "-Xmx2g -Xms2g"
  cluster.name: ${ELASTICSEARCH_CLUSTER_NAME}
  network.publish_host: ${HOSTNAME}
  transport.tcp.port: ${ELASTICSEARCH_TCP_PORT}
  http.port: ${ELASTICSEARCH_HTTP_PORT}
  discovery.zen.ping.unicast.hosts: ${HOSTNAME}
env_file:
  - .env
networks:
  - elk
ulimits:
  memlock:
    soft: -1
    hard: -1
  nofile:
    soft: 65536
    hard: 65536

```

When I start the docker I see 2 Xms and Xmx values in the log and hence the heap size is not set right.

elasticsearch\_1 | [2018-09-23T12:19:50,585][INFO][o.e.n.Node] [3J9Iack] JVM arguments [**-Xms1g, -Xmx1g** , -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch.0FKS2YNh, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs\_err\_pid%p.log, -Xlog:gc\*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Djava.locale.providers=COMPAT, -XX:UseAVX=2, -Des.cgroups.hierarchy.override=/, **-Xmx2g, -Xms2g** , -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/usr/share/elasticsearch/config, -Des.distribution.flavor=default, -Des.distribution.type=tar]

Please help me fix it.

Thank you

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 21, 2018, 12:46pm UTC](https://discuss.elastic.co/t/duplicate-xms-and-xms-values-for-elasticsearch-with-docker/149590/2 "2018-10-21T12:46:14Z")

</div>

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