# JVM heap slowly fills until server becomes unresponsive

**URL:** https://discuss.elastic.co/t/jvm-heap-slowly-fills-until-server-becomes-unresponsive/173338
**Category:** Elasticsearch
**Created:** [March 21, 2019, 3:22pm UTC](https://discuss.elastic.co/t/jvm-heap-slowly-fills-until-server-becomes-unresponsive/173338 "2019-03-21T15:22:06Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![TomCan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tomcan/32/42522_2.png) [@TomCan](https://discuss.elastic.co/u/TomCan)
#### Post date: [March 21, 2019, 3:22pm UTC](https://discuss.elastic.co/t/jvm-heap-slowly-fills-until-server-becomes-unresponsive/173338/1 "2019-03-21T15:22:06Z")

</div>

I'll start off with a brief summary of the setup:  
Single node, ES 6.4.2, Debian 9 with OpenJDK 1.8.0\_212  
+/- 500 indexes, 2500 shards, 12M documents, 3.5 GB data.  
x-pack monitoring, 60s samples, 7 days retention

What we are experiencing is that the JVM heap is slowly creeping up. Once it hits 100%, latency, segment count and GC duration go up, where GC Young drops to 0. Queries take very long causing the website that uses the ES to become unresponsive/unusable. Restarting Elasticsearch solves the problem.

 ![Screenshot%20from%202019-03-21%2016-04-50](https://us1.discourse-cdn.com/elastic/original/3X/2/5/25f581a3c7ca0d318943fce3b8150398d32327dc.png) ![Screenshot%20from%202019-03-21%2016-01-26](https://us1.discourse-cdn.com/elastic/original/3X/a/9/a994932345cc14599bd3b2fe5319645e106ba3d2.png)

Is there any way we can figure out what's happening here or what is filling up the heap, and how we can prevent this from happening?

---

<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: [March 21, 2019, 3:43pm UTC](https://discuss.elastic.co/t/jvm-heap-slowly-fills-until-server-becomes-unresponsive/173338/2 "2019-03-21T15:43:20Z")

</div>

Hi @TomCan, there is a memory leak bug that affects version 6.4.1 through 6.5.2, fixed by [#36308](https://github.com/elastic/elasticsearch/pull/36308). I suggest upgrading to a version ≥ 6.5.3 and report back if the problem persists.

---

<div class="post-metadata">

### Author: ![TomCan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tomcan/32/42522_2.png) [@TomCan](https://discuss.elastic.co/u/TomCan)
#### Post date: [March 22, 2019, 4:55pm UTC](https://discuss.elastic.co/t/jvm-heap-slowly-fills-until-server-becomes-unresponsive/173338/3 "2019-03-22T16:55:03Z")

</div>

Hi @DavidTurner, thanks for pointing that out. We've upgrade the server to 6.6 yesterday and it has been running for a day now. Memory usage is significantly lower than with 6.4 and it's very stable.

Thanks!

---

<div class="post-metadata">

### Author: ![Sai\_Birada](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sai_birada/32/142367_2.png) [@Sai\_Birada](https://discuss.elastic.co/u/Sai_Birada)
#### Post date: [March 25, 2019, 5:15am UTC](https://discuss.elastic.co/t/jvm-heap-slowly-fills-until-server-becomes-unresponsive/173338/4 "2019-03-25T05:15:14Z")

</div>

Hi @DavidTurner,  
I had exact same problem with version 6.4.3 and upgraded it to 6.6.2 hoping that it will solve, But it didnt help, I am still facing the issue, that my memory consumption slowly goes high, Gc works couple of times and pulls it back, but third time, Memory consumption spikes, holds constantly at 99% and the node eventually goes down becoming unresponsive for sometime.

 ![50%20AM](https://us1.discourse-cdn.com/elastic/original/3X/c/1/c19c40165c3f3dd2b9b97436cca05ff72e9cef80.png)

---

<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: [March 25, 2019, 7:49am UTC](https://discuss.elastic.co/t/jvm-heap-slowly-fills-until-server-becomes-unresponsive/173338/5 "2019-03-25T07:49:36Z")

</div>

@Sai_Birada Could you open another thread about this? This thread is marked "solved" so won't get as much attention now.

---

<div class="post-metadata">

### Author: ![Sai\_Birada](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sai_birada/32/142367_2.png) [@Sai\_Birada](https://discuss.elastic.co/u/Sai_Birada)
#### Post date: [March 25, 2019, 8:35am UTC](https://discuss.elastic.co/t/jvm-heap-slowly-fills-until-server-becomes-unresponsive/173338/6 "2019-03-25T08:35:32Z")

</div>

Opened new thread [here](https://discuss.elastic.co/t/elasticsearch-6-6-2-constantly-failing-with-out-of-memory-errors/173669)

---

<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: [April 22, 2019, 8:35am UTC](https://discuss.elastic.co/t/jvm-heap-slowly-fills-until-server-becomes-unresponsive/173338/7 "2019-04-22T08:35:34Z")

</div>

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