# Java heap space error when running Logstash

**URL:** <https://discuss.elastic.co/t/java-heap-space-error-when-running-logstash/71978>\
**Category:** Logstash\
**Created:** [January 18, 2017, 10:31am UTC](https://discuss.elastic.co/t/java-heap-space-error-when-running-logstash/71978 "2017-01-18T10:31:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![refai2017](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@refai2017](https://discuss.elastic.co/u/refai2017)\
**Post date:** [January 18, 2017, 10:31am UTC](https://discuss.elastic.co/t/java-heap-space-error-when-running-logstash/71978/1 "2017-01-18T10:31:07Z")

</div>

Hi Everyone ,,

I am very new to the Elastic Stack and I hope to get your help in the following problem:

I am facing the error "Java heap space" when running the Logstash, the config file contains 2 indices (one select statement for each - around 30K records will be fetched for each), the fetch size = 1000000

When changing the RAM size to be 3GB I still am facing the same error but when changing the fetch size to be 50000 it works but with a very bad performance, **any suggestions on this regard?**

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [January 18, 2017, 11:08am UTC](https://discuss.elastic.co/t/java-heap-space-error-when-running-logstash/71978/2 "2017-01-18T11:08:47Z")

</div>

Please don't post the same question multiple times under different names.

> [@Please delete](https://discuss.elastic.co/t/java-heap-space/71825):
>
> PLEASE DELETE the question

---

<div class="post-metadata">

**Author:** ![Abdullah\_Alaiwat](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Abdullah\_Alaiwat](https://discuss.elastic.co/u/Abdullah_Alaiwat)\
**Post date:** [January 18, 2017, 12:10pm UTC](https://discuss.elastic.co/t/java-heap-space-error-when-running-logstash/71978/3 "2017-01-18T12:10:46Z")

</div>

There is no delete option for the question that’s why another team member tried to ask the same question, in addition, you are not answering our questions and this seems to be a good product support and it will let us for sure take it !

---

<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 15, 2017, 12:11pm UTC](https://discuss.elastic.co/t/java-heap-space-error-when-running-logstash/71978/4 "2017-02-15T12:11:26Z")

</div>

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