# High heap usage

**URL:** <https://discuss.elastic.co/t/high-heap-usage/167530>\
**Category:** Elasticsearch\
**Created:** [February 7, 2019, 8:51pm UTC](https://discuss.elastic.co/t/high-heap-usage/167530 "2019-02-07T20:51:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivy\_Vo](https://avatars.discourse-cdn.com/v4/letter/i/54ee81/32.png) [@Ivy\_Vo](https://discuss.elastic.co/u/Ivy_Vo)\
**Post date:** [February 7, 2019, 8:51pm UTC](https://discuss.elastic.co/t/high-heap-usage/167530/1 "2019-02-07T20:51:51Z")

</div>

Hi,

I'm a beginner in ELK topic and really need help! I have a cluster with 6 nodes (3 master, 1 client and 2 data nodes). The heap configuration of each node is as below:  
master: heap 2g (half of physical RAM as recommended)  
client: heap 8g  
data heap 4g

The number of documents has been increasing recently and I see the heap memory of all nodes are increasing as well. One of the three master nodes failed-over when the heap reached 100%. So I have few things that need to be cleared:

1. Do I need to restart the service on failed master node? Of course another has take over the role, but what happens to that failed node? Could it automatically be recovered? I ask this since it happens quite regularly, almost every 2-3 days
2. How to reduce the heap used? I did disable swapping, reindexed to fewer primary shards but that does not help. I have about ~90GB data a day.

Thanks in advance

 ![monitor](https://us1.discourse-cdn.com/elastic/original/3X/c/5/c526d5fb8aa8075e9dbe53f358f38ffc467228ce.jpeg)

---

<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 8, 2019, 6:45pm UTC](https://discuss.elastic.co/t/high-heap-usage/167530/2 "2019-02-08T18:45:05Z")

</div>

Which version of Elasticsearch are you using?

---

<div class="post-metadata">

**Author:** ![Ivy\_Vo](https://avatars.discourse-cdn.com/v4/letter/i/54ee81/32.png) [@Ivy\_Vo](https://discuss.elastic.co/u/Ivy_Vo)\
**Post date:** [February 8, 2019, 6:56pm UTC](https://discuss.elastic.co/t/high-heap-usage/167530/3 "2019-02-08T18:56:17Z")

</div>

Hi,

I'm using ES version 6.5.1.

---

<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 8, 2019, 7:09pm UTC](https://discuss.elastic.co/t/high-heap-usage/167530/4 "2019-02-08T19:09:51Z")

</div>

It's possible you are affected by [https://github.com/elastic/elasticsearch/pull/36308](https://github.com/elastic/elasticsearch/pull/36308) which was fixed in 6.5.3. Can you upgrade?

---

<div class="post-metadata">

**Author:** ![Ivy\_Vo](https://avatars.discourse-cdn.com/v4/letter/i/54ee81/32.png) [@Ivy\_Vo](https://discuss.elastic.co/u/Ivy_Vo)\
**Post date:** [February 8, 2019, 7:18pm UTC](https://discuss.elastic.co/t/high-heap-usage/167530/5 "2019-02-08T19:18:10Z")

</div>

Thank you for reply! Actually I read the post but don't fully understand the concept. Could you please explain? And yes, I can upgrade if needed!

Thanks again.

---

<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 8, 2019, 7:23pm UTC](https://discuss.elastic.co/t/high-heap-usage/167530/6 "2019-02-08T19:23:13Z")

</div>

The details are not hugely important, but the key missing line in 6.5.1 is [this one](https://github.com/elastic/elasticsearch/pull/36308/files#diff-276f6ae3a5a80e59d28370051e2504c8R52). As it says in the issue, this caused

> effectively a terrible memory leak

The version you're on is affected. Moreover it can particularly affect the master node. I would encourage you to upgrade to the latest version and monitor the situation to see if the problem persists.

---

<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 8, 2019, 7:29pm UTC](https://discuss.elastic.co/t/high-heap-usage/167530/7 "2019-03-08T19:29:33Z")

</div>

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