# When starting up a ELK Cluster, one Node fails with Java lang out of memory error

**URL:** <https://discuss.elastic.co/t/when-starting-up-a-elk-cluster-one-node-fails-with-java-lang-out-of-memory-error/316693>\
**Category:** Elasticsearch\
**Created:** [October 15, 2022, 4:07pm UTC](https://discuss.elastic.co/t/when-starting-up-a-elk-cluster-one-node-fails-with-java-lang-out-of-memory-error/316693 "2022-10-15T16:07:47Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![AKAM14](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@AKAM14](https://discuss.elastic.co/u/AKAM14)\
**Post date:** [October 15, 2022, 4:07pm UTC](https://discuss.elastic.co/t/when-starting-up-a-elk-cluster-one-node-fails-with-java-lang-out-of-memory-error/316693/1 "2022-10-15T16:07:47Z")

</div>

I have a 3 node ELK Cluster - with two logstash and 1 kibana server . When i start my Elk cluster it is giving an error in two nodes and fails. it is all realted to Jvm memory error. I have attached the error screenshot.

can you please let me know how to increase the jvm memory. i have added a jvm.option file , but it is not reading the xms-12g and xmx 12g at all when the cluster starts up. not sure where am i going wrong

---

<div class="post-metadata">

**Author:** ![AKAM14](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@AKAM14](https://discuss.elastic.co/u/AKAM14)\
**Post date:** [October 15, 2022, 4:10pm UTC](https://discuss.elastic.co/t/when-starting-up-a-elk-cluster-one-node-fails-with-java-lang-out-of-memory-error/316693/2 "2022-10-15T16:10:03Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/e/b/eb46f5f75c78cf0202f5c9e6ff8b39f3f740586b.png)

---

<div class="post-metadata">

**Author:** ![AKAM14](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@AKAM14](https://discuss.elastic.co/u/AKAM14)\
**Post date:** [October 16, 2022, 8:20am UTC](https://discuss.elastic.co/t/when-starting-up-a-elk-cluster-one-node-fails-with-java-lang-out-of-memory-error/316693/3 "2022-10-16T08:20:51Z")

</div>

In this screenshot it shows the node has only 1gb.. while i have allocated xms -12g and xmx- 12g in the jvm.options file . not sure why elk is taking the jvm has 1g. while the node server has 32gb available

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [October 16, 2022, 2:45pm UTC](https://discuss.elastic.co/t/when-starting-up-a-elk-cluster-one-node-fails-with-java-lang-out-of-memory-error/316693/4 "2022-10-16T14:45:56Z")

</div>

Where you have put settings? config\jvm.options or config\jvm.options.d\jvm.options ?  
Must be in: `config\jvm.options.d\jvm.options`

---

<div class="post-metadata">

**Author:** ![AKAM14](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@AKAM14](https://discuss.elastic.co/u/AKAM14)\
**Post date:** [October 17, 2022, 1:23am UTC](https://discuss.elastic.co/t/when-starting-up-a-elk-cluster-one-node-fails-with-java-lang-out-of-memory-error/316693/5 "2022-10-17T01:23:12Z")

</div>

Hi Rios,

Yes I have put the settings in the jvm.options,.d/jvm.options file . One quick question -  
in the jvm.options file - just putting this settings is fine is this correct

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/d/0d6ba905735262a3d8095317a6e5582cec4fd5f5.png)

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [October 17, 2022, 2:30am UTC](https://discuss.elastic.co/t/when-starting-up-a-elk-cluster-one-node-fails-with-java-lang-out-of-memory-error/316693/6 "2022-10-17T02:30:49Z")

</div>

You have a space before `-Xms16g` and `-Xmx16g`, try to remove the space and start again as there should be no space.

The space can make the config to not be taken in consideration.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 17, 2022, 3:00am UTC](https://discuss.elastic.co/t/when-starting-up-a-elk-cluster-one-node-fails-with-java-lang-out-of-memory-error/316693/7 "2022-10-17T03:00:01Z")

</div>

Please don't post pictures of text, logs or code. They are difficult to read, impossible to search and replicate (if it's code), and some people may not be even able to see them 🙂

---

<div class="post-metadata">

**Author:** ![AKAM14](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@AKAM14](https://discuss.elastic.co/u/AKAM14)\
**Post date:** [October 18, 2022, 12:11am UTC](https://discuss.elastic.co/t/when-starting-up-a-elk-cluster-one-node-fails-with-java-lang-out-of-memory-error/316693/8 "2022-10-18T00:11:55Z")

</div>

I have done the required changes, even then when i start the cluster the node fails with the jvm heap memory issue. not sure where am i going wrong. can you please help me with this

---

<div class="post-metadata">

**Author:** ![AKAM14](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@AKAM14](https://discuss.elastic.co/u/AKAM14)\
**Post date:** [October 18, 2022, 2:46am UTC](https://discuss.elastic.co/t/when-starting-up-a-elk-cluster-one-node-fails-with-java-lang-out-of-memory-error/316693/9 "2022-10-18T02:46:34Z")

</div>

I got it resolved.. for some reasons ELK was not reading my new file - jvm.options file. once it started reading the file. where i have increased my java heap size . the issue got resolved.

thank you for your quick help

---

<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:** [November 15, 2022, 2:46am UTC](https://discuss.elastic.co/t/when-starting-up-a-elk-cluster-one-node-fails-with-java-lang-out-of-memory-error/316693/10 "2022-11-15T02:46:43Z")

</div>

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