# How to configure heap size on 5.x installed from .deb?

**URL:** https://discuss.elastic.co/t/how-to-configure-heap-size-on-5-x-installed-from-deb/77373
**Category:** Logstash
**Created:** [March 4, 2017, 12:29am UTC](https://discuss.elastic.co/t/how-to-configure-heap-size-on-5-x-installed-from-deb/77373 "2017-03-04T00:29:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![FlorinAndrei](https://avatars.discourse-cdn.com/v4/letter/f/54ee81/32.png) [@FlorinAndrei](https://discuss.elastic.co/u/FlorinAndrei)
#### Post date: [March 4, 2017, 12:29am UTC](https://discuss.elastic.co/t/how-to-configure-heap-size-on-5-x-installed-from-deb/77373/1 "2017-03-04T00:29:08Z")

</div>

I've installed Logstash-5.2.2 from the .deb file on Ubuntu 16.04

In `/etc/default/logstash` I have this:

`LS_JAVA_OPTS="-Xms8g -Xmx8g"`

And I can verify that the Logstash Java process indeed has the `-Xmx8g -Xms8g` options.

But if I check the memory usage, it's more like 2 GB or so. Logstash does not seem to use the amount of heap it's configured with.

With Logstash 2.x if I put `LS_HEAP_SIZE="8g"` in `/etc/default/logstash`, it would actually use 8 GB.

What's going on here? What is the "officially correct" way to define the heap size for Logstash-5.x installed from .deb?

---

<div class="post-metadata">

### Author: ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)
#### Post date: [March 4, 2017, 12:43am UTC](https://discuss.elastic.co/t/how-to-configure-heap-size-on-5-x-installed-from-deb/77373/2 "2017-03-04T00:43:46Z")

</div>

Edit `/etc/logstash/jvm.options`

---

<div class="post-metadata">

### Author: ![FlorinAndrei](https://avatars.discourse-cdn.com/v4/letter/f/54ee81/32.png) [@FlorinAndrei](https://discuss.elastic.co/u/FlorinAndrei)
#### Post date: [March 7, 2017, 6:53pm UTC](https://discuss.elastic.co/t/how-to-configure-heap-size-on-5-x-installed-from-deb/77373/3 "2017-03-07T18:53:10Z")

</div>

Nevermind. Setting `LS_JAVA_OPTS` in `/etc/default/logstash` actually grew the heap size, but it happened very slowly, over almost a couple days or so. Now memory usage is as it should be.

I will also try `/etc/logstash/jvm.options` when I get a chance. 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: [April 4, 2017, 6:53pm UTC](https://discuss.elastic.co/t/how-to-configure-heap-size-on-5-x-installed-from-deb/77373/4 "2017-04-04T18:53:22Z")

</div>

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