# Elasticsearch 7.1x + Java 11: Possible GC misconfiguration

**URL:** <https://discuss.elastic.co/t/elasticsearch-7-1x-java-11-possible-gc-misconfiguration/197709>\
**Category:** Elasticsearch\
**Created:** [September 2, 2019, 3:03pm UTC](https://discuss.elastic.co/t/elasticsearch-7-1x-java-11-possible-gc-misconfiguration/197709 "2019-09-02T15:03:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bruno\_Andrade](https://avatars.discourse-cdn.com/v4/letter/b/7ea924/32.png) [@Bruno\_Andrade](https://discuss.elastic.co/u/Bruno_Andrade)\
**Post date:** [September 2, 2019, 3:03pm UTC](https://discuss.elastic.co/t/elasticsearch-7-1x-java-11-possible-gc-misconfiguration/197709/1 "2019-09-02T15:03:36Z")

</div>

Hey guys,

We're facing some problems with instances going down from time to time with "exiting  
java.lang.OutOfMemoryError: Java heap space".

Currently:

- Elasticsearch 7.1.1
- Java 11
- G1GC and default jvm.options configs
- 2.5b docs.
- 1 index with 40 shards (20 p + 20 r)
- 2.2TB in primary data.
- 12 x 32gb ram instance with 16gb allocated to Elasticsearch (50%)
- cluster in AWS

In logs, we can also see this logs from GC:

> [gc][2072844] overhead, spent [6s] collecting in the last [6.1s]
> 
> [old][2072844][25] duration [6s], collections [1]/[6.1s], total [6s]/[2.2m], memory [15.3gb]-\>[15gb]/[16gb], all\_pools {[young] [8mb]-\>[0b]/[0b]}{[old] [15.3gb]-\>[15gb]/[16gb]}{[survivor] [0b]-\>[0b]/[0b]}

When the instance go with "OutOfMemoryError: Java heap space" and stop the service, I see that the GC count and time increased for that instance

Also, we run some tasks every day that generates stats from docs, which can take up to the last 30 days of data. When this task runs, sometimes the same problems occur, but not always.

Do you guys have any clue in where I can go further and debug this?

---

<div class="post-metadata">

**Author:** ![HenningAndersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henningandersen/32/48188_2.png) [@HenningAndersen](https://discuss.elastic.co/u/HenningAndersen)\
**Post date:** [September 2, 2019, 5:52pm UTC](https://discuss.elastic.co/t/elasticsearch-7-1x-java-11-possible-gc-misconfiguration/197709/2 "2019-09-02T17:52:28Z")

</div>

Hi @Bruno_Andrade,

the first stop I think would be to load the heap dump produced by this into a tool to examine what objects you have. I can recommend eclipse memory analyzer, but there are plenty other tools available too (jprofiler, yourkit etc.).

---

<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:** [September 30, 2019, 5:52pm UTC](https://discuss.elastic.co/t/elasticsearch-7-1x-java-11-possible-gc-misconfiguration/197709/3 "2019-09-30T17:52:32Z")

</div>

Closed on September 30, 2019, 5:52pm UTC

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