# Elasticsearch ram size

**URL:** <https://discuss.elastic.co/t/elasticsearch-ram-size/286449>\
**Category:** Elasticsearch\
**Created:** [October 12, 2021, 8:27am UTC](https://discuss.elastic.co/t/elasticsearch-ram-size/286449 "2021-10-12T08:27:03Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![tahseen\_fatima](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tahseen_fatima/32/67789_2.png) [@tahseen\_fatima](https://discuss.elastic.co/u/tahseen_fatima)\
**Post date:** [October 12, 2021, 8:27am UTC](https://discuss.elastic.co/t/elasticsearch-ram-size/286449/1 "2021-10-12T08:27:03Z")

</div>

Hi Team,

I have installed Elasticsearch on windows 2016 server for the first time with hardware configuration of 16GB ram, 64 - bit OS, 8 core.

Now I want set the heap size of the elastic cluster.  
What heap size should I have to assign for this and why?

Kindly help,  
Tahseen

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 12, 2021, 10:00am UTC](https://discuss.elastic.co/t/elasticsearch-ram-size/286449/2 "2021-10-12T10:00:05Z")

</div>

Elasticsearch now automatically sets the HEAP size for you. See [Important Elasticsearch configuration | Elasticsearch Guide [7.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html#heap-size-settings)

---

<div class="post-metadata">

**Author:** ![tahseen\_fatima](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tahseen_fatima/32/67789_2.png) [@tahseen\_fatima](https://discuss.elastic.co/u/tahseen_fatima)\
**Post date:** [October 12, 2021, 1:50pm UTC](https://discuss.elastic.co/t/elasticsearch-ram-size/286449/3 "2021-10-12T13:50:50Z")

</div>

Thank you for the quick response, but I have installed 7.7 version of Elasticsearch. And for the older version we need to set the heap size.  
What elastic recommend for the windows 64-bit os with 16GM ram size.  
Can you help me with this setting?

Regards,  
Tahseen

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 12, 2021, 2:03pm UTC](https://discuss.elastic.co/t/elasticsearch-ram-size/286449/4 "2021-10-12T14:03:09Z")

</div>

I'd recommend to upgrade to 7.15.0.

For 7.7, you can look at [Setting the heap size | Elasticsearch Guide [7.7] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.7/heap-size.html) but read carefully the last part of the page.

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [October 12, 2021, 3:03pm UTC](https://discuss.elastic.co/t/elasticsearch-ram-size/286449/5 "2021-10-12T15:03:22Z")

</div>

David,  
what is setting to let Elasticsearch decide about jvm.  
documentation didn't mention about that

It only said below. I am confuse. is this telling me not to touch jvm.options file and Elasticsearch will decide jvm heap by node role? am i correct on this assumption?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/a/4ad688fda088dd543490b3c371b54b930851e094.png)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 12, 2021, 3:18pm UTC](https://discuss.elastic.co/t/elasticsearch-ram-size/286449/6 "2021-10-12T15:18:37Z")

</div>

The documentation you took a screenshot from is for Elasticsearch 7.15, which I recommended to use earlier in this thread.

> [@elasticforme](#):
>
> what is setting to let Elasticsearch decide about jvm.

The link I shared for 7.7 ([Setting the heap size | Elasticsearch Guide [7.7] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.7/heap-size.html)) says:

> - 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.
> - Set `Xmx` and `Xms` to no more than the threshold that the JVM uses for compressed object pointers (compressed oops); the exact threshold varies but is near 32 GB.

So use Half of the RAM available and no more than 30gb of HEAP.

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [October 12, 2021, 3:20pm UTC](https://discuss.elastic.co/t/elasticsearch-ram-size/286449/7 "2021-10-12T15:20:55Z")

</div>

yes I am using 7.15. just upgraded  
so it is not automatic. you still have to edit jvm.options file and use 50% ? (default suggested by ELK)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 12, 2021, 3:30pm UTC](https://discuss.elastic.co/t/elasticsearch-ram-size/286449/8 "2021-10-12T15:30:56Z")

</div>

So in 7.15, it's automatic.

Why do you say it's not?

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [October 12, 2021, 3:47pm UTC](https://discuss.elastic.co/t/elasticsearch-ram-size/286449/9 "2021-10-12T15:47:10Z")

</div>

David,  
I might have not understanding what here automatic vs manual.  
automatic for me is I don't have to change anything and Elasticsearch will choose jvm heap by taking 50% for actual memory

manual means I update jvm.options file, add jvm heap and start elasticearch.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 12, 2021, 3:59pm UTC](https://discuss.elastic.co/t/elasticsearch-ram-size/286449/10 "2021-10-12T15:59:59Z")

</div>

> [@elasticforme](#):
>
> automatic for me is I don't have to change anything and Elasticsearch will choose jvm heap by taking 50% for actual memory

Yes.

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [October 12, 2021, 4:02pm UTC](https://discuss.elastic.co/t/elasticsearch-ram-size/286449/11 "2021-10-12T16:02:58Z")

</div>

Thank you for full explanation.

---

<div class="post-metadata">

**Author:** ![tahseen\_fatima](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tahseen_fatima/32/67789_2.png) [@tahseen\_fatima](https://discuss.elastic.co/u/tahseen_fatima)\
**Post date:** [October 13, 2021, 4:47am UTC](https://discuss.elastic.co/t/elasticsearch-ram-size/286449/12 "2021-10-13T04:47:28Z")

</div>

Thank you @dadoonet , for the advice I'll upgrade it to 7.15.

Regards,  
Tahseen

---

<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:** [November 10, 2021, 4:48am UTC](https://discuss.elastic.co/t/elasticsearch-ram-size/286449/13 "2021-11-10T04:48:16Z")

</div>

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