# Logstash JVM GC "Allocation Failure"

**URL:** <https://discuss.elastic.co/t/logstash-jvm-gc-allocation-failure/42498>\
**Category:** Logstash\
**Created:** [February 23, 2016, 2:02pm UTC](https://discuss.elastic.co/t/logstash-jvm-gc-allocation-failure/42498 "2016-02-23T14:02:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebuildy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebuildy/32/6070_2.png) [@ebuildy](https://discuss.elastic.co/u/ebuildy)\
**Post date:** [February 23, 2016, 2:02pm UTC](https://discuss.elastic.co/t/logstash-jvm-gc-allocation-failure/42498/1 "2016-02-23T14:02:24Z")

</div>

I run Logstash 2.2 with head size of 8G:

> export LS\_HEAP\_SIZE=8G

> exec setuser logstash logstash agent   
> --pipeline-workers 4   
> --pipeline-batch-size 2500   
> --pipeline-batch-delay 10   
> -f /etc/service/logstash/logstash.conf

ps -aux gives:

[http://b3.ms/P5Z9ZQxDMlbr](http://b3.ms/P5Z9ZQxDMlbr)

Saying memory is 11Mo. But, running "jstat -gccause 98 2000", it complains:

"Allocation Failure"

Is it normal? (also I always get high CPU as soon as I send few events via any input plugins, tried with TCP, UDP, RabbitMQ).

Thanks,

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 23, 2016, 6:51pm UTC](https://discuss.elastic.co/t/logstash-jvm-gc-allocation-failure/42498/2 "2016-02-23T18:51:04Z")

</div>

Why so high? Unless you are pushing massive messages through LS, you don't really need more than 4GB.

---

<div class="post-metadata">

**Author:** ![ebuildy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebuildy/32/6070_2.png) [@ebuildy](https://discuss.elastic.co/u/ebuildy)\
**Post date:** [February 23, 2016, 7:26pm UTC](https://discuss.elastic.co/t/logstash-jvm-gc-allocation-failure/42498/3 "2016-02-23T19:26:52Z")

</div>

I don't know 😉 as I see "Allocation Failure" Java error (JVM debug), I though more heap could help.

I try to reduce the CPU logstash is consuming (very high compared to Fluentd, for almost same pipeline TCP =\> filter =\> elasticsearch).

Is it something normal because the jRuby?

Thanks,

---

<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, 5:10am UTC](https://discuss.elastic.co/t/logstash-jvm-gc-allocation-failure/42498/4 "2017-07-06T05:10:00Z")

</div>


