# Logstash not starting with 'Cannot allocate memory' error

**URL:** <https://discuss.elastic.co/t/logstash-not-starting-with-cannot-allocate-memory-error/88558>\
**Category:** Logstash\
**Created:** [June 7, 2017, 10:59am UTC](https://discuss.elastic.co/t/logstash-not-starting-with-cannot-allocate-memory-error/88558 "2017-06-07T10:59:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aarishramesh](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@aarishramesh](https://discuss.elastic.co/u/aarishramesh)\
**Post date:** [June 7, 2017, 10:59am UTC](https://discuss.elastic.co/t/logstash-not-starting-with-cannot-allocate-memory-error/88558/1 "2017-06-07T10:59:47Z")

</div>

I have set up ELK in my aws t2.medium instance (4 GB RAM) & it was working fine until today morning when logstash failed. This was the error I encountered while trying to start logstash

```
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0000000, 
174456832, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 174456832 bytes for committing reserved 
memory.
# An error report file with more information is saved as:
# /home/ubuntu/hs_err_pid24701.log

```

jvm.options for logstash has -Xmx to 1 GB & -Xms to 256 MB. For elastic search it is max heap is 2 GB & min heap is 256 MB

But on checking the memory usage on the instance, top command shows  
KiB Mem: 4046832 total, 3927576 used, 119256 free, 13144 buffers.

I am not sure how 3.9 GB RAM is being used as elastic search , kibana are all idle with Logstash being down.

So can someone help me explain how can this ram issue be fixed ?

---

<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 5, 2017, 11:00am UTC](https://discuss.elastic.co/t/logstash-not-starting-with-cannot-allocate-memory-error/88558/2 "2017-07-05T11:00:04Z")

</div>

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