# \[Solved\] Logstash can't start up: not enough memory

**URL:** <https://discuss.elastic.co/t/solved-logstash-cant-start-up-not-enough-memory/51372>\
**Category:** Logstash\
**Created:** [May 31, 2016, 5:38am UTC](https://discuss.elastic.co/t/solved-logstash-cant-start-up-not-enough-memory/51372 "2016-05-31T05:38:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Morriaty](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@Morriaty](https://discuss.elastic.co/u/Morriaty)\
**Post date:** [May 31, 2016, 5:38am UTC](https://discuss.elastic.co/t/solved-logstash-cant-start-up-not-enough-memory/51372/1 "2016-05-31T05:38:20Z")

</div>

This is what `top` showed

```auto
top - 13:28:06 up 837 days, 15:14, 6 users, load average: 0.17, 0.13, 0.16
Tasks: 352 total, 2 running, 350 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.3%us, 0.1%sy, 0.0%ni, 99.3%id, 0.0%wa, 0.0%hi, 0.2%si, 0.0%st
Mem: 16432788k total, 830188k used, 15602600k free, 2576k buffers
Swap: 18481144k total, 2343896k used, 16137248k free, 141652k cached

```

I suppose the free memory was enough.

And I can't find any document about how to configure logstash's memory allocation.

Thank you for help.

---

<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:** [May 31, 2016, 7:39am UTC](https://discuss.elastic.co/t/solved-logstash-cant-start-up-not-enough-memory/51372/2 "2016-05-31T07:39:03Z")

</div>

You have tons of free memory. What's the exact error message and where did you find it? The Logstash log?

> And I can't find any document about how to configure logstash's memory allocation.

The JVM heap size is configured via startup options that are normally set via /etc/default/logstash (Debian-based systems) or /etc/sysconfig/logstash (RPM-based systems).

---

<div class="post-metadata">

**Author:** ![Morriaty](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@Morriaty](https://discuss.elastic.co/u/Morriaty)\
**Post date:** [May 31, 2016, 7:55am UTC](https://discuss.elastic.co/t/solved-logstash-cant-start-up-not-enough-memory/51372/3 "2016-05-31T07:55:30Z")

</div>

The error msg showed just I typed

```auto
$ ./logstash -h
Can't start up: not enough memory

```

I've tried set the env param `export LS_HEAP_SIZE=500m`, and logstash ran. But I couldn't figure out what happened.

---

<div class="post-metadata">

**Author:** ![purbon](https://avatars.discourse-cdn.com/v4/letter/p/edb3f5/32.png) [@purbon](https://discuss.elastic.co/u/purbon)\
**Post date:** [May 31, 2016, 9:28am UTC](https://discuss.elastic.co/t/solved-logstash-cant-start-up-not-enough-memory/51372/4 "2016-05-31T09:28:45Z")

</div>

Logstash is currently, by default started with heap config like [https://github.com/elastic/logstash/blob/master/pkg/jvm.options#L6-L7](https://github.com/elastic/logstash/blob/master/pkg/jvm.options#L6-L7), you can see it does between Xms256m and -Xmx1g, so you should be covered.

can you share with us your logstash version? and machine specs? as @magnusbaeck said from your top command it really looks like you got enough memory.

---

<div class="post-metadata">

**Author:** ![Morriaty](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@Morriaty](https://discuss.elastic.co/u/Morriaty)\
**Post date:** [May 31, 2016, 10:09am UTC](https://discuss.elastic.co/t/solved-logstash-cant-start-up-not-enough-memory/51372/5 "2016-05-31T10:09:15Z")

</div>

I solved this problem by upgrading java from 1.4 to 1.8.

It seemed the problem was caused by low java version.

Thank you for 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:** [July 6, 2017, 4:55am UTC](https://discuss.elastic.co/t/solved-logstash-cant-start-up-not-enough-memory/51372/6 "2017-07-06T04:55:20Z")

</div>


