# Logstash Java heap space

**URL:** <https://discuss.elastic.co/t/logstash-java-heap-space/140394>\
**Category:** Logstash\
**Created:** [July 17, 2018, 8:21pm UTC](https://discuss.elastic.co/t/logstash-java-heap-space/140394 "2018-07-17T20:21:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![irom77](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/irom77/32/12976_2.png) [@irom77](https://discuss.elastic.co/u/irom77)\
**Post date:** [July 17, 2018, 8:21pm UTC](https://discuss.elastic.co/t/logstash-java-heap-space/140394/1 "2018-07-17T20:21:57Z")

</div>

My logstash 6.3 running in docker is failing, see below:  
`
logstash_1 | java.lang.OutOfMemoryError: Java heap space
logstash_1 | Dumping heap to java_pid1.hprof ...
logstash_1 | Unable to create java_pid1.hprof: File exists
logstash_1 | [2018-07-17T19:43:41,313][ERROR][org.logstash.Logstash] java.lang.OutOfMemoryError: Java heap space
`

I have LS\_JAVA\_OPTS: "-Xmx256m -Xms256m" and ES\_JAVA\_OPTS: "-Xmx256m -Xms256m", how much mem should I assign (I have 32g avail) ?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 17, 2018, 11:53pm UTC](https://discuss.elastic.co/t/logstash-java-heap-space/140394/2 "2018-07-17T23:53:03Z")

</div>

256m is really small! The smallest I use now is -Xmx750m (because 500m stopped working when I upgraded to 6.3). If you want to tune it then read [this](https://www.elastic.co/guide/en/logstash/current/tuning-logstash.html). If memory is free and you just want to get it up and running I would try -Xms1000m -Xmx2000m.

---

<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:** [August 14, 2018, 11:53pm UTC](https://discuss.elastic.co/t/logstash-java-heap-space/140394/3 "2018-08-14T23:53:04Z")

</div>

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