# ES\_JAVA\_OPTS exceding memory usage

**URL:** <https://discuss.elastic.co/t/es-java-opts-exceding-memory-usage/216888>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [January 28, 2020, 5:15pm UTC](https://discuss.elastic.co/t/es-java-opts-exceding-memory-usage/216888 "2020-01-28T17:15:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sirius](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sirius/32/47012_2.png) [@Sirius](https://discuss.elastic.co/u/Sirius)\
**Post date:** [January 28, 2020, 5:15pm UTC](https://discuss.elastic.co/t/es-java-opts-exceding-memory-usage/216888/1 "2020-01-28T17:15:12Z")

</div>

Hi,

I'm running an ES cluster with 3 nodes using docker compose, my 3 nodes have the same below environment JAVA OPTS configuration. My understanding setting such value it would limit the memory usage, my node1 and 2 are rounding the 20 gb, it's ok, but my concern is why my node3 is exceding to 25 gb of usage.

```
environment:
  - bootstrap.memory_lock=true
  - "ES_JAVA_OPTS=-Xms20g -Xmx20g"

```

Example,

node3:  
 ![2020-01-28 11_05_20-root@sacvl1191__el1_app_elkstack_docker](https://us1.discourse-cdn.com/elastic/original/3X/4/c/4ced69fa3f7603750c6b255e0ab374dee0e86925.png)

node1 and 2:  
 ![node1](https://us1.discourse-cdn.com/elastic/original/3X/9/6/964f0885733f3c1e6a09752d6ca9a1d954c0cd2b.png)

Any help is very appreciable .

Regards,  
Jorge

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [January 28, 2020, 8:13pm UTC](https://discuss.elastic.co/t/es-java-opts-exceding-memory-usage/216888/2 "2020-01-28T20:13:44Z")

</div>

`-Xmx` sets the maximum heap size, but there's other things that use memory apart from the heap. From [the docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html) (emphasis mine):

> Set `Xmx` and `Xms` to no more than 50% of your physical RAM. Elasticsearch requires memory for purposes other than the JVM heap and it is important to leave space for this. For instance, Elasticsearch uses off-heap buffers for efficient network communication, relies on the operating system’s filesystem cache for efficient access to files, and the JVM itself requires some memory too. **It is normal to observe the Elasticsearch process using more memory than the limit configured with the `Xmx` setting.**

---

<div class="post-metadata">

**Author:** ![Sirius](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sirius/32/47012_2.png) [@Sirius](https://discuss.elastic.co/u/Sirius)\
**Post date:** [January 29, 2020, 5:34pm UTC](https://discuss.elastic.co/t/es-java-opts-exceding-memory-usage/216888/3 "2020-01-29T17:34:33Z")

</div>

Thanks David this information helped me a lot.

---

<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:** [February 26, 2020, 5:34pm UTC](https://discuss.elastic.co/t/es-java-opts-exceding-memory-usage/216888/4 "2020-02-26T17:34:40Z")

</div>

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