# The environment LS\_HEAP\_SIZE setting

**URL:** <https://discuss.elastic.co/t/the-environment-ls-heap-size-setting/55363>\
**Category:** Logstash\
**Created:** [July 13, 2016, 2:38am UTC](https://discuss.elastic.co/t/the-environment-ls-heap-size-setting/55363 "2016-07-13T02:38:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiaozhuqq48](https://avatars.discourse-cdn.com/v4/letter/x/97f17d/32.png) [@xiaozhuqq48](https://discuss.elastic.co/u/xiaozhuqq48)\
**Post date:** [July 13, 2016, 2:38am UTC](https://discuss.elastic.co/t/the-environment-ls-heap-size-setting/55363/1 "2016-07-13T02:38:10Z")

</div>

I'm using bin/logstash -f xx.conf -b 2000 -m 6,

but i get a warning, "CAUTION: Recommended inflight events max exceeded!.xxxxxxxxxxxxxxxxx this may cause instability with the default heap size. please consider setting a non-standard heap size,changing the batch size(currently 2000)", or changing the number of pipeline workers(currently 6) {:level=\>:warn}"

I set "export LS\_HEAP\_SIZE="2g" ", or in /etc/profile, still won't work.

could anyone help? thanks

---

<div class="post-metadata">

**Author:** ![xiaozhuqq48](https://avatars.discourse-cdn.com/v4/letter/x/97f17d/32.png) [@xiaozhuqq48](https://discuss.elastic.co/u/xiaozhuqq48)\
**Post date:** [July 13, 2016, 3:59am UTC](https://discuss.elastic.co/t/the-environment-ls-heap-size-setting/55363/2 "2016-07-13T03:59:45Z")

</div>

How to increase LS\_HEAP\_SIZE, when I run "bin/logstash -f xx -b xx -w xx" from the tar.gz?

---

<div class="post-metadata">

**Author:** ![Joshua\_Rich](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshua_rich/32/44953_2.png) [@Joshua\_Rich](https://discuss.elastic.co/u/Joshua_Rich)\
**Post date:** [July 13, 2016, 5:06am UTC](https://discuss.elastic.co/t/the-environment-ls-heap-size-setting/55363/3 "2016-07-13T05:06:55Z")

</div>

Hi @xiaozhuqq48,

If you are just running it directly from a terminal, try:

`LS_HEAP_SIZE=4g bin/logstash <args>`

---

<div class="post-metadata">

**Author:** ![xiaozhuqq48](https://avatars.discourse-cdn.com/v4/letter/x/97f17d/32.png) [@xiaozhuqq48](https://discuss.elastic.co/u/xiaozhuqq48)\
**Post date:** [July 13, 2016, 8:04am UTC](https://discuss.elastic.co/t/the-environment-ls-heap-size-setting/55363/4 "2016-07-13T08:04:39Z")

</div>

I did as you told.  
But it's still warning  
"CAUTION:Recommended inflight events max exceeded! Logstash will run with up to 12000events in memory in your current configuration. If your message sizes are large this may cause instability with the default heap size. please consider setting a non-standard heap size,changing the batch size(currently 2000)", or changing the number of pipeline workers(currently 6) {:level=\>:warn}"

or will the warning still come out even after the LS\_HEAP\_SIZE becomes 4g？How can I be sure the LS\_HEAP\_SIZE changes to 4g?

---

<div class="post-metadata">

**Author:** ![xiaozhuqq48](https://avatars.discourse-cdn.com/v4/letter/x/97f17d/32.png) [@xiaozhuqq48](https://discuss.elastic.co/u/xiaozhuqq48)\
**Post date:** [July 13, 2016, 8:17am UTC](https://discuss.elastic.co/t/the-environment-ls-heap-size-setting/55363/5 "2016-07-13T08:17:36Z")

</div>

I use jmap to confirm that the MaxHeapSize is 4G. So it did work.  
Thanks.

---

<div class="post-metadata">

**Author:** ![anhlqn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anhlqn/32/5454_2.png) [@anhlqn](https://discuss.elastic.co/u/anhlqn)\
**Post date:** [July 15, 2016, 6:16am UTC](https://discuss.elastic.co/t/the-environment-ls-heap-size-setting/55363/6 "2016-07-15T06:16:17Z")

</div>

I also have the same concern. Is that warning safe to ignore? My input to Logstash is about 1500 EPS, and I've tried to set batch size to 3000 and flush\_size to 3000 but still getting that warning.

---

<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:47am UTC](https://discuss.elastic.co/t/the-environment-ls-heap-size-setting/55363/7 "2017-07-06T04:47:56Z")

</div>


