# Java Heap logstash

**URL:** <https://discuss.elastic.co/t/java-heap-logstash/365601>\
**Category:** Logstash\
**Created:** [August 27, 2024, 7:51am UTC](https://discuss.elastic.co/t/java-heap-logstash/365601 "2024-08-27T07:51:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![devops\_training](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/devops_training/32/131845_2.png) [@devops\_training](https://discuss.elastic.co/u/devops_training)\
**Post date:** [August 27, 2024, 7:51am UTC](https://discuss.elastic.co/t/java-heap-logstash/365601/1 "2024-08-27T07:51:05Z")

</div>

```auto
[2024-08-16T07:54:27,150][FATAL][org.logstash.Logstash] uncaught error (in thread pool-701-thread-1)
java.lang.OutOfMemoryError: Java heap space

```

I will be running one pipeline. Haven't changed any default settings.

pipeline.batch.size: 125  
pipeline.batch.delay: 50

Please suggest how to replicate this issue and how to solve this in dev environment.

---

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [August 27, 2024, 8:07am UTC](https://discuss.elastic.co/t/java-heap-logstash/365601/2 "2024-08-27T08:07:21Z")

</div>

Hi,

Please take a look at the [documentation](https://www.elastic.co/guide/en/logstash/current/jvm-settings.html):

You can use the `jvm.options` file to set JVM settings like `-Xmx` to increase the heap size. I think the default is 1GB, so you may try to increase this as per your needs.

Best regards  
Wolfram

---

<div class="post-metadata">

**Author:** ![devops\_training](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/devops_training/32/131845_2.png) [@devops\_training](https://discuss.elastic.co/u/devops_training)\
**Post date:** [October 29, 2024, 4:06pm UTC](https://discuss.elastic.co/t/java-heap-logstash/365601/3 "2024-10-29T16:06:25Z")

</div>

Thanks @Wolfram_Haussig.

Just to understand more. The system is not providing logstash 1G of heap memory or logstash needs more than 1 GB of memory.

---

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [October 30, 2024, 5:20am UTC](https://discuss.elastic.co/t/java-heap-logstash/365601/4 "2024-10-30T05:20:57Z")

</div>

> [@devops\_training](#):
>
> The system is not providing logstash 1G of heap memory or logstash needs more than 1 GB of memory.

By default `-Xms` (minimum heap) and `-Xmx` (maximum heap) are set to the same value and this is also recommended. This means that Logstash would fail at startup if it cannot claim the required heapsize.

From the log message, I assume that the error occurs at runtime which means that your Logstash instance needs a larger heap.
