# Elastic node crashing due to java.lang.OutOfMemoryError: Java heap space

**URL:** <https://discuss.elastic.co/t/elastic-node-crashing-due-to-java-lang-outofmemoryerror-java-heap-space/337034>\
**Category:** Elasticsearch\
**Created:** [June 28, 2023, 5:22am UTC](https://discuss.elastic.co/t/elastic-node-crashing-due-to-java-lang-outofmemoryerror-java-heap-space/337034 "2023-06-28T05:22:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sasvmware](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@sasvmware](https://discuss.elastic.co/u/sasvmware)\
**Post date:** [June 28, 2023, 5:22am UTC](https://discuss.elastic.co/t/elastic-node-crashing-due-to-java-lang-outofmemoryerror-java-heap-space/337034/1 "2023-06-28T05:22:56Z")

</div>

Hi

Elasticsearch nodes are crashing due to java.lang.OutOfMemoryError: Java heap space.  
We have 10 GB memory in each node and as per formula total memory/2 -1 we have set JVM as 4.

ava.lang.OutOfMemoryError: Java heap space  
[2023-06-27T21:12:11,961][INFO][o.e.m.j.JvmGcMonitorService] [[xxelk-xxx-md2.xxxxxx.com](http://xxelk-xxx-md2.xxxxxx.com)] [gc][408948] overhead, spent [430ms] collecting in the last [1.3s]  
Dumping heap to data ...  
Unable to create data: File exists  
Terminating due to java.lang.OutOfMemoryError: Java heap space

Please find out \_cluster/stats?pretty&human  
{  
"\_nodes" : {  
"total" : 3,  
"successful" : 3,  
"failed" : 0  
},  
"cluster\_name" : "xx-xxx",  
"cluster\_uuid" : "iT7eW-FIQbGMmlVqdKItDg",  
"timestamp" : 1687928792818,  
"status" : "green",  
"indices" : {  
"count" : 52,  
"shards" : {  
"total" : 183,  
"primaries" : 84,  
"replication" : 1.1785714285714286,  
"index" : {  
"shards" : {  
"min" : 2,  
"max" : 10,  
"avg" : 3.519230769230769  
},  
"primaries" : {  
"min" : 1,  
"max" : 5,  
"avg" : 1.6153846153846154  
},  
"replication" : {  
"min" : 1.0,  
"max" : 2.0,  
"avg" : 1.2115384615384615  
}  
}  
},  
"docs" : {  
"count" : 4596015,  
"deleted" : 2118561  
},  
"store" : {  
"size" : "32gb",  
"size\_in\_bytes" : 34445260661,  
"total\_data\_set\_size" : "32gb",  
"total\_data\_set\_size\_in\_bytes" : 34445260661,  
"reserved" : "0b",  
"reserved\_in\_bytes" : 0  
},  
"fielddata" : {  
"memory\_size" : "25.5kb",  
"memory\_size\_in\_bytes" : 26168,  
"evictions" : 0  
},  
"query\_cache" : {  
"memory\_size" : "14.1mb",  
"memory\_size\_in\_bytes" : 14883132,  
"total\_count" : 1524264,  
"hit\_count" : 119039,  
"miss\_count" : 1405225,  
"cache\_size" : 3957,  
"cache\_count" : 4144,  
"evictions" : 187  
},  
"completion" : {  
"size" : "0b",  
"size\_in\_bytes" : 0  
},  
"segments" : {  
"count" : 663,  
"memory" : "10.9mb",  
"memory\_in\_bytes" : 11459618,  
"terms\_memory" : "7.3mb",  
"terms\_memory\_in\_bytes" : 7720984,  
"stored\_fields\_memory" : "326.2kb",  
"stored\_fields\_memory\_in\_bytes" : 334040,  
"term\_vectors\_memory" : "115.2kb",  
"term\_vectors\_memory\_in\_bytes" : 118024,  
"norms\_memory" : "1.2mb",  
"norms\_memory\_in\_bytes" : 1288128,  
"points\_memory" : "0b",  
"points\_memory\_in\_bytes" : 0,  
"doc\_values\_memory" : "1.9mb",  
"doc\_values\_memory\_in\_bytes" : 1998442,  
"index\_writer\_memory" : "1.6mb",  
"index\_writer\_memory\_in\_bytes" : 1781972,  
"version\_map\_memory" : "0b",  
"version\_map\_memory\_in\_bytes" : 0,  
"fixed\_bit\_set" : "1.7mb",  
"fixed\_bit\_set\_memory\_in\_bytes" : 1846360,  
"max\_unsafe\_auto\_id\_timestamp" : 1687926871781,  
"file\_sizes" : { }  
},  
"mappings" : {  
"field\_types" : [  
{  
"name" : "boolean",  
"count" : 67,  
"index\_count" : 27,  
"script\_count" : 0  
},  
{  
"name" : "constant\_keyword",  
"count" : 6,  
"index\_count" : 2,  
"script\_count" : 0  
},  
{  
"name" : "date",  
"count" : 133,  
"index\_count" : 33,  
"script\_count" : 0  
},  
{  
"name" : "double",  
"count" : 2,  
"index\_count" : 2,  
"script\_count" : 0  
},  
{  
"name" : "float",  
"count" : 79,  
"index\_count" : 12,  
"script\_count" : 0  
},  
{  
"name" : "geo\_point",  
"count" : 2,  
"index\_count" : 2,  
"script\_count" : 0  
},  
{  
"name" : "half\_float",  
"count" : 56,  
"index\_count" : 14,  
"script\_count" : 0  
},  
{  
"name" : "integer",  
"count" : 155,  
"index\_count" : 8,  
"script\_count" : 0  
},  
{  
"name" : "ip",  
"count" : 2,  
"index\_count" : 2,  
"script\_count" : 0  
},  
{  
"name" : "keyword",  
"count" : 913,  
"index\_count" : 42,  
"script\_count" : 0  
},  
{  
"name" : "long",  
"count" : 1360,  
"index\_count" : 33,  
"script\_count" : 0  
},  
{  
"name" : "nested",  
"count" : 29,  
"index\_count" : 15,  
"script\_count" : 0  
},  
{  
"name" : "object",  
"count" : 878,  
"index\_count" : 28,  
"script\_count" : 0  
},  
{  
"name" : "scaled\_float",  
"count" : 1,  
"index\_count" : 1,  
"script\_count" : 0  
},  
{  
"name" : "text",  
"count" : 575,  
"index\_count" : 31,  
"script\_count" : 0  
},  
{  
"name" : "version",  
"count" : 4,  
"index\_count" : 4,  
"script\_count" : 0  
}  
],  
"runtime\_field\_types" :   
},  
"analysis" : {  
"char\_filter\_types" : ,  
"tokenizer\_types" : ,  
"filter\_types" : [  
{  
"name" : "stemmer",  
"count" : 6,  
"index\_count" : 2  
},  
{  
"name" : "stop",  
"count" : 4,  
"index\_count" : 2  
},  
{  
"name" : "synonym\_graph",  
"count" : 4,  
"index\_count" : 2  
}  
],  
"analyzer\_types" : [  
{  
"name" : "custom",  
"count" : 6,  
"index\_count" : 2  
}  
],  
"built\_in\_char\_filters" : ,  
"built\_in\_tokenizers" : [  
{  
"name" : "keyword",  
"count" : 2,  
"index\_count" : 2  
},  
{  
"name" : "standard",  
"count" : 4,  
"index\_count" : 2  
}  
],  
"built\_in\_filters" : [  
{  
"name" : "lowercase",  
"count" : 6,  
"index\_count" : 2  
}  
],  
"built\_in\_analyzers" : [  
{  
"name" : "arabic",  
"count" : 5,  
"index\_count" : 1  
},  
{  
"name" : "basque",  
"count" : 5,  
"index\_count" : 1  
},  
{  
"name" : "brazilian",  
"count" : 5,  
"index\_count" : 1  
},  
{  
"name" : "bulgarian",  
"count" : 5,  
"index\_count" : 1  
},  
{  
"name" : "catalan",  
"count" : 12,  
"index\_count" : 2  
},  
{  
"name" : "cjk",  
"count" : 5,  
"index\_count" : 1  
},  
{  
"name" : "czech",  
"count" : 5,  
"index\_count" : 1  
},  
{  
"name" : "danish",  
"count" : 5,  
"index\_count" : 1  
},  
{  
"name" : "dutch",  
"count" : 10,  
"index\_count" : 1  
},  
{  
"name" : "english",  
"count" : 34,  
"index\_count" : 2  
},  
{  
"name" : "finnish",  
"count" : 5,  
"index\_count" : 1  
},  
{  
"name" : "french",  
"count" : 12,  
"index\_count" : 2  
},  
{  
"name" : "german",  
"count" : 7,  
"index\_count" : 2  
},  
{  
"name" : "greek",  
"count" : 5,  
"index\_count" : 1  
},  
{  
"name" : "hindi",  
"count" : 5,  
"index\_count" : 1  
},  
{  
"name" : "hungarian",  
"count" : 5,  
"index\_count" : 1  
},  
{  
"name" : "italian",  
"count" : 5,  
"index\_count" : 1  
},  
{  
"name" : "kuromoji",  
"count" : 9,  
"index\_count" : 2  
},  
{  
"name" : "norwegian",  
"count" : 5,  
"index\_count" : 1  
},  
{  
"name" : "polish",  
"count" : 5,  
"index\_count" : 1  
},  
{  
"name" : "portuguese",  
"count" : 5,  
"index\_count" : 1  
},  
{  
"name" : "romanian",  
"count" : 5,  
"index\_count" : 1  
},  
{  
"name" : "russian",  
"count" : 5,  
"index\_count" : 1  
},  
{  
"name" : "smartcn",  
"count" : 12,  
"index\_count" : 2  
},  
{  
"name" : "spanish",  
"count" : 7,  
"index\_count" : 2  
},  
{  
"name" : "swedish",  
"count" : 5,  
"index\_count" : 1  
},  
{  
"name" : "thai",  
"count" : 5,  
"index\_count" : 1  
},  
{  
"name" : "turkish",  
"count" : 5,  
"index\_count" : 1  
}  
]  
},  
"versions" : [  
{  
"version" : "6.8.7",  
"index\_count" : 11,  
"primary\_shard\_count" : 39,  
"total\_primary\_size" : "1.1mb",  
"total\_primary\_bytes" : 1197211  
},  
{  
"version" : "7.17.5",  
"index\_count" : 41,  
"primary\_shard\_count" : 45,  
"total\_primary\_size" : "11.4gb",  
"total\_primary\_bytes" : 12269704622  
}  
]  
},  
"nodes" : {  
"count" : {  
"total" : 3,  
"coordinating\_only" : 0,  
"data" : 3,  
"data\_cold" : 3,  
"data\_content" : 3,  
"data\_frozen" : 3,  
"data\_hot" : 3,  
"data\_warm" : 3,  
"ingest" : 3,  
"master" : 3,  
"ml" : 0,  
"remote\_cluster\_client" : 3,  
"transform" : 3,  
"voting\_only" : 0  
},  
"versions" : [  
"7.17.5"  
],  
"os" : {  
"available\_processors" : 12,  
"allocated\_processors" : 12,  
"names" : [  
{  
"name" : "Linux",  
"count" : 3  
}  
],  
"pretty\_names" : [  
{  
"pretty\_name" : "CentOS Linux 7 (Core)",  
"count" : 3  
}  
],  
"architectures" : [  
{  
"arch" : "amd64",  
"count" : 3  
}  
],  
"mem" : {  
"total" : "29.2gb",  
"total\_in\_bytes" : 31451197440,  
"free" : "491.6mb",  
"free\_in\_bytes" : 515579904,  
"used" : "28.8gb",  
"used\_in\_bytes" : 30935617536,  
"free\_percent" : 2,  
"used\_percent" : 98  
}  
},  
"process" : {  
"cpu" : {  
"percent" : 9  
},  
"open\_file\_descriptors" : {  
"min" : 759,  
"max" : 835,  
"avg" : 788  
}  
},  
"jvm" : {  
"max\_uptime" : "2.1d",  
"max\_uptime\_in\_millis" : 187409634,  
"versions" : [  
{  
"version" : "18.0.1.1",  
"vm\_name" : "OpenJDK 64-Bit Server VM",  
"vm\_version" : "18.0.1.1+2-6",  
"vm\_vendor" : "Oracle Corporation",  
"bundled\_jdk" : true,  
"using\_bundled\_jdk" : true,  
"count" : 3  
}  
],  
"mem" : {  
"heap\_used" : "5.9gb",  
"heap\_used\_in\_bytes" : 6349027064,  
"heap\_max" : "12gb",  
"heap\_max\_in\_bytes" : 12884901888  
},  
"threads" : 244  
},  
"fs" : {  
"total" : "294.9gb",  
"total\_in\_bytes" : 316651905024,  
"free" : "249gb",  
"free\_in\_bytes" : 267377627136,  
"available" : "233.9gb",  
"available\_in\_bytes" : 251221807104  
},  
"plugins" : [  
{  
"name" : "analysis-phonetic",  
"version" : "7.17.5",  
"elasticsearch\_version" : "7.17.5",  
"java\_version" : "1.8",  
"description" : "The Phonetic Analysis plugin integrates phonetic token filter analysis with elasticsearch.",  
"classname" : "org.elasticsearch.plugin.analysis.phonetic.AnalysisPhoneticPlugin",  
"extended\_plugins" : ,  
"has\_native\_controller" : false,  
"licensed" : false,  
"type" : "isolated"  
},  
{  
"name" : "analysis-kuromoji",  
"version" : "7.17.5",  
"elasticsearch\_version" : "7.17.5",  
"java\_version" : "1.8",  
"description" : "The Japanese (kuromoji) Analysis plugin integrates Lucene kuromoji analysis module into elasticsearch.",  
"classname" : "org.elasticsearch.plugin.analysis.kuromoji.AnalysisKuromojiPlugin",  
"extended\_plugins" : ,  
"has\_native\_controller" : false,  
"licensed" : false,  
"type" : "isolated"  
},  
{  
"name" : "analysis-icu",  
"version" : "7.17.5",  
"elasticsearch\_version" : "7.17.5",  
"java\_version" : "1.8",  
"description" : "The ICU Analysis plugin integrates the Lucene ICU module into Elasticsearch, adding ICU-related analysis components.",  
"classname" : "org.elasticsearch.plugin.analysis.icu.AnalysisICUPlugin",  
"extended\_plugins" : ,  
"has\_native\_controller" : false,  
"licensed" : false,  
"type" : "isolated"  
},  
{  
"name" : "analysis-ukrainian",  
"version" : "7.17.5",  
"elasticsearch\_version" : "7.17.5",  
"java\_version" : "1.8",  
"description" : "The Ukrainian Analysis plugin integrates the Lucene UkrainianMorfologikAnalyzer into elasticsearch.",  
"classname" : "org.elasticsearch.plugin.analysis.ukrainian.AnalysisUkrainianPlugin",  
"extended\_plugins" : ,  
"has\_native\_controller" : false,  
"licensed" : false,  
"type" : "isolated"  
},  
{  
"name" : "analysis-smartcn",  
"version" : "7.17.5",  
"elasticsearch\_version" : "7.17.5",  
"java\_version" : "1.8",  
"description" : "Smart Chinese Analysis plugin integrates Lucene Smart Chinese analysis module into elasticsearch.",  
"classname" : "org.elasticsearch.plugin.analysis.smartcn.AnalysisSmartChinesePlugin",  
"extended\_plugins" : ,  
"has\_native\_controller" : false,  
"licensed" : false,  
"type" : "isolated"  
},  
{  
"name" : "analysis-nori",  
"version" : "7.17.5",  
"elasticsearch\_version" : "7.17.5",  
"java\_version" : "1.8",  
"description" : "The Korean (nori) Analysis plugin integrates Lucene nori analysis module into elasticsearch.",  
"classname" : "org.elasticsearch.plugin.analysis.nori.AnalysisNoriPlugin",  
"extended\_plugins" : ,  
"has\_native\_controller" : false,  
"licensed" : false,  
"type" : "isolated"  
},  
{  
"name" : "analysis-stempel",  
"version" : "7.17.5",  
"elasticsearch\_version" : "7.17.5",  
"java\_version" : "1.8",  
"description" : "The Stempel (Polish) Analysis plugin integrates Lucene stempel (polish) analysis module into elasticsearch.",  
"classname" : "org.elasticsearch.plugin.analysis.stempel.AnalysisStempelPlugin",  
"extended\_plugins" : ,  
"has\_native\_controller" : false,  
"licensed" : false,  
"type" : "isolated"  
}  
],  
"network\_types" : {  
"transport\_types" : {  
"netty4" : 3  
},  
"http\_types" : {  
"netty4" : 3  
}  
},  
"discovery\_types" : {  
"zen" : 3  
},  
"packaging\_types" : [  
{  
"flavor" : "default",  
"type" : "tar",  
"count" : 3  
}  
],  
"ingest" : {  
"number\_of\_pipelines" : 3,  
"processor\_stats" : {  
"gsub" : {  
"count" : 0,  
"failed" : 0,  
"current" : 0,  
"time" : "0s",  
"time\_in\_millis" : 0  
},  
"rename" : {  
"count" : 0,  
"failed" : 0,  
"current" : 0,  
"time" : "0s",  
"time\_in\_millis" : 0  
},  
"script" : {  
"count" : 0,  
"failed" : 0,  
"current" : 0,  
"time" : "0s",  
"time\_in\_millis" : 0  
},  
"set" : {  
"count" : 0,  
"failed" : 0,  
"current" : 0,  
"time" : "0s",  
"time\_in\_millis" : 0  
}  
}  
}  
}  
}

---

<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:** [July 26, 2023, 5:23am UTC](https://discuss.elastic.co/t/elastic-node-crashing-due-to-java-lang-outofmemoryerror-java-heap-space/337034/2 "2023-07-26T05:23:18Z")

</div>

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