# Why export ES\_HEAP\_SIZE=2g or bin/elasticsearch bin/elasticsearch --network.host 0.0.0.0 -Xmx2g -Xms2g not work

**URL:** <https://discuss.elastic.co/t/why-export-es-heap-size-2g-or-bin-elasticsearch-bin-elasticsearch-network-host-0-0-0-0-xmx2g-xms2g-not-work/56847>\
**Category:** Elasticsearch\
**Created:** [August 1, 2016, 2:44am UTC](https://discuss.elastic.co/t/why-export-es-heap-size-2g-or-bin-elasticsearch-bin-elasticsearch-network-host-0-0-0-0-xmx2g-xms2g-not-work/56847 "2016-08-01T02:44:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![figo10203](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@figo10203](https://discuss.elastic.co/u/figo10203)\
**Post date:** [August 1, 2016, 2:44am UTC](https://discuss.elastic.co/t/why-export-es-heap-size-2g-or-bin-elasticsearch-bin-elasticsearch-network-host-0-0-0-0-xmx2g-xms2g-not-work/56847/1 "2016-08-01T02:44:26Z")

</div>

Hi body,  
My es version is 2.3.3 and I want to upgrade es memory to 2g from default value(1g).

following the document I firstly export environment ES\_HEAP\_SIZE in user bash file and restarting es. but the heap keep displaying 1g as it previously was(see the below graph), then I append -Xmx2g -Xms2g after my startup command "bin/elasticsearch bin/elasticsearch --network.host 0.0.0.0 -Xmx2g -Xms2g" , but still the heap keep as the old(see the below graph).

 ![](https://us1.discourse-cdn.com/elastic/original/2X/5/5de6855960914ce747150da1f2ee42f71f71f53c.png)

Could somebody tell me why and how to set heap size?  
Thanks a lot in advance

---

<div class="post-metadata">

**Author:** ![Joshua\_Rich](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshua_rich/32/44953_2.png) [@Joshua\_Rich](https://discuss.elastic.co/u/Joshua_Rich)\
**Post date:** [August 1, 2016, 6:14am UTC](https://discuss.elastic.co/t/why-export-es-heap-size-2g-or-bin-elasticsearch-bin-elasticsearch-network-host-0-0-0-0-xmx2g-xms2g-not-work/56847/2 "2016-08-01T06:14:58Z")

</div>

In the output of `ps -fC java` on the server running Elasticsearch, what are the values for the `-Xms` and `-Xmx` options? Do you see `ES_HEAP_SIZE` in the list of enviornment variables when you run `cat /proc/<PID>/environment | tr \\0 \\n` (where `<PID>` is the process ID of the Elasticsearch process)? Is there any warnings or errors printed when you start Elasticsearch?

---

<div class="post-metadata">

**Author:** ![figo10203](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@figo10203](https://discuss.elastic.co/u/figo10203)\
**Post date:** [August 1, 2016, 8:13am UTC](https://discuss.elastic.co/t/why-export-es-heap-size-2g-or-bin-elasticsearch-bin-elasticsearch-network-host-0-0-0-0-xmx2g-xms2g-not-work/56847/3 "2016-08-01T08:13:23Z")

</div>

> [@Joshua\_Rich](#):
>
> | tr \0 \n

Hi Joshua\_Rich, the command **env** returns includes ES\_HEAP\_SIZE=2g. but **cat /proc/PID/environ | tr \0 \n** doesn't. I've export in /etc/profile file(see below), so why ES\_HEAP\_SIZE is not object to the PID and how to set?

 ![](https://us1.discourse-cdn.com/elastic/original/2X/2/29a654814f1c0b5c2fa1aaa1743444a7e853ee34.png)

---

<div class="post-metadata">

**Author:** ![figo10203](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@figo10203](https://discuss.elastic.co/u/figo10203)\
**Post date:** [August 1, 2016, 8:54am UTC](https://discuss.elastic.co/t/why-export-es-heap-size-2g-or-bin-elasticsearch-bin-elasticsearch-network-host-0-0-0-0-xmx2g-xms2g-not-work/56847/4 "2016-08-01T08:54:42Z")

</div>

issue solved, the cause is restart supervisord is necessary when es is started via supervisord.

Thanks Joshua\_Rich

---

<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:** [July 5, 2017, 10:31pm UTC](https://discuss.elastic.co/t/why-export-es-heap-size-2g-or-bin-elasticsearch-bin-elasticsearch-network-host-0-0-0-0-xmx2g-xms2g-not-work/56847/5 "2017-07-05T22:31:17Z")

</div>


