# About setting of heap size in elastic search

**URL:** <https://discuss.elastic.co/t/about-setting-of-heap-size-in-elastic-search/232194>\
**Category:** Elasticsearch\
**Created:** [May 12, 2020, 10:15am UTC](https://discuss.elastic.co/t/about-setting-of-heap-size-in-elastic-search/232194 "2020-05-12T10:15:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pratiksha](https://avatars.discourse-cdn.com/v4/letter/p/cab0a1/32.png) [@pratiksha](https://discuss.elastic.co/u/pratiksha)\
**Post date:** [May 12, 2020, 10:15am UTC](https://discuss.elastic.co/t/about-setting-of-heap-size-in-elastic-search/232194/1 "2020-05-12T10:15:05Z")

</div>

As per the document [https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html#heap-size](https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html#heap-size) , It is recommended to set Xmx and Xms for heap size to not more than 50% of available memory. But if we have segregated elastic search roles like master only, data only and ingest nodes , Would the JVM needs change?  
This 50% rule needs to be kept for all the roles?  
And what issues do we face in case we donot follow this recommendation?

---

<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:** [May 12, 2020, 2:47pm UTC](https://discuss.elastic.co/t/about-setting-of-heap-size-in-elastic-search/232194/2 "2020-05-12T14:47:41Z")

</div>

> [@pratiksha](#):
>
> This 50% rule needs to be kept for all the roles?

Yes.

> [@pratiksha](#):
>
> And what issues do we face in case we donot follow this recommendation?

If your heap size exceeds 50% of your available memory then the node may use more than 100% of the available memory, which is obviously not possible so usually results in the node being killed.

---

<div class="post-metadata">

**Author:** ![epeterson79](https://avatars.discourse-cdn.com/v4/letter/e/ecae2f/32.png) [@epeterson79](https://discuss.elastic.co/u/epeterson79)\
**Post date:** [May 12, 2020, 4:09pm UTC](https://discuss.elastic.co/t/about-setting-of-heap-size-in-elastic-search/232194/3 "2020-05-12T16:09:10Z")

</div>

Hello!

Very new to ELk stack, Im running elk in a docker container on Ubuntu. I keep getting the following just loading visualizations:

"[esaggs] \> Request to Elasticsearch failed: {"statusCode":429,"error":"Too Many Requests","message":"[circuit\_breaking\_exception] [parent] Data too large, data for [\<http\_request\>] would be [248561544/237mb], which is larger than the limit of [246546432/235.1mb], real usage: [248561544/237mb], new bytes reserved: [0/0b], usages [request=0/0b, fielddata=14976/14.6kb, in\_flight\_requests=0/0b, accounting=6377785/6mb], with { bytes\_wanted=248561544 & bytes\_limit=246546432 & durability="PERMANENT" }"}"

from what I searched, the heap size is the culprit. I have adjust to 4G on both Xmx and Xms and keep getting the error. Also that value of 235.1 never changes?

Any ideas?

---

<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:** [June 9, 2020, 4:09pm UTC](https://discuss.elastic.co/t/about-setting-of-heap-size-in-elastic-search/232194/4 "2020-06-09T16:09:11Z")

</div>

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