# Fatal Error in thread Elasticsearch

**URL:** <https://discuss.elastic.co/t/fatal-error-in-thread-elasticsearch/214360>\
**Category:** Elasticsearch\
**Created:** [January 9, 2020, 7:51am UTC](https://discuss.elastic.co/t/fatal-error-in-thread-elasticsearch/214360 "2020-01-09T07:51:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![vivektsb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vivektsb/32/49029_2.png) [@vivektsb](https://discuss.elastic.co/u/vivektsb)\
**Post date:** [January 9, 2020, 7:51am UTC](https://discuss.elastic.co/t/fatal-error-in-thread-elasticsearch/214360/1 "2020-01-09T07:51:28Z")

</div>

Hi Team,

We have 7 node elasticsearch cluster we are facing sometimes facing the same issue in the following topic.

> [@My elasticsearch fatal error in thread](https://discuss.elastic.co/t/my-elasticsearch-fatal-error-in-thread/140645):
>
> that is log [2018-07-19T10:08:09,453][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [] fatal error in thread [elasticsearch[cvhieo8][management][T#1848]], exiting java.lang.OutOfMemoryError: Java heap space Heap Total 276.86 MB Heap Used 259.31 MB and it not on my pc , i cant ask 9200

Please find our cluster statistics please let us know are we doing something wrong with shard size or Heap size.

{  
"\_nodes" : {  
"total" : 7,  
"successful" : 7,  
"failed" : 0  
},  
"cluster\_name" : "cul-prim-prod",  
"cluster\_uuid" : "X4QaFpncQeyyb\_hxC-G54Q",  
"timestamp" : 1578555450588,  
"status" : "green",  
"indices" : {  
"count" : 46,  
"shards" : {  
"total" : 292,  
"primaries" : 146,  
"replication" : 1.0,  
"index" : {  
"shards" : {  
"min" : 2,  
"max" : 10,  
"avg" : 6.3478260869565215  
},  
"primaries" : {  
"min" : 1,  
"max" : 5,  
"avg" : 3.1739130434782608  
},  
"replication" : {  
"min" : 1.0,  
"max" : 1.0,  
"avg" : 1.0  
}  
}  
},  
"docs" : {  
"count" : 3362009859,  
"deleted" : 25461  
},  
"store" : {  
"size\_in\_bytes" : 10665225023735  
},  
"fielddata" : {  
"memory\_size\_in\_bytes" : 567400,  
"evictions" : 0  
},  
"query\_cache" : {  
"memory\_size\_in\_bytes" : 970304418,  
"total\_count" : 6764188043,  
"hit\_count" : 1083259,  
"miss\_count" : 6763104784,  
"cache\_size" : 1353748,  
"cache\_count" : 1374718,  
"evictions" : 20970  
},  
"completion" : {  
"size\_in\_bytes" : 0  
},  
"segments" : {  
"count" : 5305,  
"memory\_in\_bytes" : 12608131101,  
"terms\_memory\_in\_bytes" : 9957812822,  
"stored\_fields\_memory\_in\_bytes" : 2158594512,  
"term\_vectors\_memory\_in\_bytes" : 0,  
"norms\_memory\_in\_bytes" : 55541504,  
"points\_memory\_in\_bytes" : 379701971,  
"doc\_values\_memory\_in\_bytes" : 56480292,  
"index\_writer\_memory\_in\_bytes" : 1494975972,  
"version\_map\_memory\_in\_bytes" : 0,  
"fixed\_bit\_set\_memory\_in\_bytes" : 910208,  
"max\_unsafe\_auto\_id\_timestamp" : 1578554123176,  
"file\_sizes" : { }  
}  
},  
"nodes" : {  
"count" : {  
"total" : 7,  
"data" : 7,  
"coordinating\_only" : 0,  
"master" : 5,  
"ingest" : 5  
},  
"versions" : [  
"6.7.1"  
],  
"os" : {  
"available\_processors" : 56,  
"allocated\_processors" : 56,  
"names" : [  
{  
"name" : "Linux",  
"count" : 7  
}  
],  
"pretty\_names" : [  
{  
"pretty\_name" : "Ubuntu 16.04.6 LTS",  
"count" : 7  
}  
],  
"mem" : {  
"total\_in\_bytes" : 472925831168,  
"free\_in\_bytes" : 17409150976,  
"used\_in\_bytes" : 455516680192,  
"free\_percent" : 4,  
"used\_percent" : 96  
}  
},  
"process" : {  
"cpu" : {  
"percent" : 174  
},  
"open\_file\_descriptors" : {  
"min" : 614,  
"max" : 780,  
"avg" : 694  
}  
},  
"jvm" : {  
"max\_uptime\_in\_millis" : 10798483409,  
"versions" : [  
{  
"version" : "1.8.0\_232",  
"vm\_name" : "OpenJDK 64-Bit Server VM",  
"vm\_version" : "25.232-b09",  
"vm\_vendor" : "Private Build",  
"count" : 5  
},  
{  
"version" : "1.8.0\_222",  
"vm\_name" : "OpenJDK 64-Bit Server VM",  
"vm\_version" : "25.222-b10",  
"vm\_vendor" : "Private Build",  
"count" : 2  
}  
],  
"mem" : {  
"heap\_used\_in\_bytes" : 112234882040,  
"heap\_max\_in\_bytes" : 240030056448  
},  
"threads" : 742  
},  
"fs" : {  
"total\_in\_bytes" : 37701522087936,  
"free\_in\_bytes" : 26274215526400,  
"available\_in\_bytes" : 24374004559872  
},  
"plugins" : ,  
"network\_types" : {  
"transport\_types" : {  
"security4" : 7  
},  
"http\_types" : {  
"security4" : 7  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [January 9, 2020, 3:48pm UTC](https://discuss.elastic.co/t/fatal-error-in-thread-elasticsearch/214360/2 "2020-01-09T15:48:54Z")

</div>

this seems to be an exception, that you are running out of memory (and thus the process gets killed instead of running in a ghost state).

Are there any more logs before the event happening?

Have you configured the same heap size for all of your systems?

Did you change any of your elasticsearch configuration? Are you running big aggregations or other operations that may potentially require a lot of memory?

Also, is this a customized JDK build?

---

<div class="post-metadata">

**Author:** ![vivektsb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vivektsb/32/49029_2.png) [@vivektsb](https://discuss.elastic.co/u/vivektsb)\
**Post date:** [January 9, 2020, 5:25pm UTC](https://discuss.elastic.co/t/fatal-error-in-thread-elasticsearch/214360/3 "2020-01-09T17:25:23Z")

</div>

Thanks for support.We ran queries with aggregations post that issue occured.Do you have any suggestions for running queries or aggregations.Please let us know.

Regards,  
Vivek

---

<div class="post-metadata">

**Author:** ![vivektsb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vivektsb/32/49029_2.png) [@vivektsb](https://discuss.elastic.co/u/vivektsb)\
**Post date:** [January 10, 2020, 5:58am UTC](https://discuss.elastic.co/t/fatal-error-in-thread-elasticsearch/214360/4 "2020-01-10T05:58:55Z")

</div>

Can we configure more than 32 GB Heap (Say 48 GB ) with 64 GB RAM.?

Regards,  
Vivek

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 10, 2020, 6:11am UTC](https://discuss.elastic.co/t/fatal-error-in-thread-elasticsearch/214360/5 "2020-01-10T06:11:36Z")

</div>

Don't ask the same question multiple times please. [Elasticsearch Heapsize query](https://discuss.elastic.co/t/elasticsearch-heapsize-query/214537) is a duplicate then.

---

<div class="post-metadata">

**Author:** ![vivektsb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vivektsb/32/49029_2.png) [@vivektsb](https://discuss.elastic.co/u/vivektsb)\
**Post date:** [January 10, 2020, 6:15am UTC](https://discuss.elastic.co/t/fatal-error-in-thread-elasticsearch/214360/6 "2020-01-10T06:15:26Z")

</div>

Sure...Thought of maintaining different thread for this different question.

Thanks,  
Vivek

---

<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:** [January 10, 2020, 6:31am UTC](https://discuss.elastic.co/t/fatal-error-in-thread-elasticsearch/214360/7 "2020-01-10T06:31:12Z")

</div>

It seems your heap size is set quite close to 32gb which may mean that you are not using compressed pointers. The recommendation is generally to not set it larger that around 30GB. You may want to try decreasing it to this and see if it make a difference.

It may also help if you describe the use case and the types of aggregations you are running as someone might be able to help you improve this.

---

<div class="post-metadata">

**Author:** ![vivektsb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vivektsb/32/49029_2.png) [@vivektsb](https://discuss.elastic.co/u/vivektsb)\
**Post date:** [January 10, 2020, 7:42am UTC](https://discuss.elastic.co/t/fatal-error-in-thread-elasticsearch/214360/8 "2020-01-10T07:42:13Z")

</div>

Thank you @Christian\_Dahlqvist..We will try that and get back to you ...

Regards,  
Vivek

---

<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:** [February 7, 2020, 7:42am UTC](https://discuss.elastic.co/t/fatal-error-in-thread-elasticsearch/214360/9 "2020-02-07T07:42:16Z")

</div>

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