# java.lang.OutOfMemoryError: Java heap space

**URL:** <https://discuss.elastic.co/t/java-lang-outofmemoryerror-java-heap-space/259773>\
**Category:** Logstash\
**Created:** [December 29, 2020, 6:40am UTC](https://discuss.elastic.co/t/java-lang-outofmemoryerror-java-heap-space/259773 "2020-12-29T06:40:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rknd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rknd/32/103882_2.png) [@rknd](https://discuss.elastic.co/u/rknd)\
**Post date:** [December 29, 2020, 6:40am UTC](https://discuss.elastic.co/t/java-lang-outofmemoryerror-java-heap-space/259773/1 "2020-12-29T06:40:40Z")

</div>

Hello everyone I've got this error.  
java.lang.OutOfMemoryError: Java heap space  
When I run my pipeline.  
I set jvm option the below. But still getting this jvm error.  
-Xms8M  
-Xmx8M  
How can i solve ? Can someone explain ? Thanks for answering

---

<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:** [December 30, 2020, 10:57pm UTC](https://discuss.elastic.co/t/java-lang-outofmemoryerror-java-heap-space/259773/2 "2020-12-30T22:57:42Z")

</div>

What version are you on? What is the full error? What is your OS? What is your config?

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [December 30, 2020, 11:20pm UTC](https://discuss.elastic.co/t/java-lang-outofmemoryerror-java-heap-space/259773/3 "2020-12-30T23:20:17Z")

</div>

It looks like you're setting your heap size to 8 _megabytes_, which Elasticsearch can't possibly run with. Is that just a typo? Here is some documentation about setting the heap size: [https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html#heap-size-settings](https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html#heap-size-settings)

---

<div class="post-metadata">

**Author:** ![rknd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rknd/32/103882_2.png) [@rknd](https://discuss.elastic.co/u/rknd)\
**Post date:** [January 9, 2021, 8:18am UTC](https://discuss.elastic.co/t/java-lang-outofmemoryerror-java-heap-space/259773/4 "2021-01-09T08:18:36Z")

</div>

Yes I ve miss typed that. But I have changed it to 8g and also try 10g but still have same issue.

> [@java.lang.OutOfMemoryError: Java heap space in Logstash](https://discuss.elastic.co/t/java-lang-outofmemoryerror-java-heap-space-in-logstash/260596):
>
> I have too many configuration files. I run these files together via pipelines.yml. I use these types of settings likewise below; - pipeline.id: pipeline1 path.config: "path\_to\_pipeline1" - pipeline.id: pipeline2 path.config: "path\_to\_pipeline2" - pipeline.id: pipeline3 path.config: "path\_to\_pipeline3" ..... I set JVM HeapSize as 10gb with the configuration below; (I have also tried 8gb and I have 16gb ram) -Xms10g -Xmx10g If I run my pipelines one by one. It works perfectly but when …

---

<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 8, 2021, 6:53am UTC](https://discuss.elastic.co/t/java-lang-outofmemoryerror-java-heap-space/259773/6 "2021-02-08T06:53:25Z")

</div>

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