# HEAP Sizing on Data Nodes

**URL:** <https://discuss.elastic.co/t/heap-sizing-on-data-nodes/169534>\
**Category:** Elasticsearch\
**Created:** [February 22, 2019, 8:51am UTC](https://discuss.elastic.co/t/heap-sizing-on-data-nodes/169534 "2019-02-22T08:51:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)\
**Post date:** [February 22, 2019, 8:51am UTC](https://discuss.elastic.co/t/heap-sizing-on-data-nodes/169534/1 "2019-02-22T08:51:36Z")

</div>

Hi,  
Conventional wisdom states that 50% of RAM should be allocated to the JVM. However, where the bulk of the work done by the cluster is indexing, such as the logging use case, doesn't that justify increasing HEAP allocation above 50% to help with indexing?

Regards,  
D

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [February 22, 2019, 8:55am UTC](https://discuss.elastic.co/t/heap-sizing-on-data-nodes/169534/2 "2019-02-22T08:55:07Z")

</div>

A larger heap does not necessarily improve indexing throughput. As outlined in [this blog post](https://www.elastic.co/blog/a-heap-of-trouble) you should look to make it as small as possible while ensuring that you do not suffer long or extensive GC once the node fills up or when you query your data. Elasticsearch also uses off-heap data, so I would not recommend going above 50% of available RAM.

---

<div class="post-metadata">

**Author:** ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)\
**Post date:** [February 25, 2019, 8:27am UTC](https://discuss.elastic.co/t/heap-sizing-on-data-nodes/169534/3 "2019-02-25T08:27:24Z")

</div>

When you say "off-heap data" are you referring to FS buffers are other off-heap memory requirements?

---

<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:** [February 25, 2019, 8:58am UTC](https://discuss.elastic.co/t/heap-sizing-on-data-nodes/169534/4 "2019-02-25T08:58:43Z")

</div>

It depends a bit on which version you're using and how your system is configured, but a major user of off-heap memory allocation is for network communication, and indexing involves quite a lot of this. Running out of off-heap memory is pretty bad (on Linux, it can lead to the process being killed by the OOM killer rather than reclaiming some of it via GC).

---

<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:** [March 25, 2019, 8:58am UTC](https://discuss.elastic.co/t/heap-sizing-on-data-nodes/169534/5 "2019-03-25T08:58:44Z")

</div>

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