# Excessive RAM usage, gets OOM killed in logstash

**URL:** <https://discuss.elastic.co/t/excessive-ram-usage-gets-oom-killed-in-logstash/340716>\
**Category:** Logstash\
**Created:** [August 14, 2023, 7:02am UTC](https://discuss.elastic.co/t/excessive-ram-usage-gets-oom-killed-in-logstash/340716 "2023-08-14T07:02:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanveer14](https://avatars.discourse-cdn.com/v4/letter/t/e19b73/32.png) [@tanveer14](https://discuss.elastic.co/u/tanveer14)\
**Post date:** [August 14, 2023, 7:02am UTC](https://discuss.elastic.co/t/excessive-ram-usage-gets-oom-killed-in-logstash/340716/1 "2023-08-14T07:02:05Z")

</div>

Hi!

I'm running pipelines on logstash. Everything ran smoothly, but the POD went down for a certain amount of time. In values.yml ll set JVM option as "logstashJavaOpts: "-Xmx5g -Xms3g" still end up getting killed by the OOM killer.

How would I be able to control RAM usage, to prevent logstash from being killed?

Also i am not able to find logstash log file inside the pod.

Thanks in advance for your help,

Tanveer

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [August 14, 2023, 7:16am UTC](https://discuss.elastic.co/t/excessive-ram-usage-gets-oom-killed-in-logstash/340716/2 "2023-08-14T07:16:32Z")

</div>

Welcome to the community!  
RAM consumption depend on amount of data in the pipeline. Larger XML/JSON or files consume more.  
You can set to:` -Xms4g -Xmx4g`

- Set the minimum (Xms) and maximum (Xmx) heap allocation size to the same value to prevent the heap from resizing at runtime, which is a very costly process.

Read [more](https://www.elastic.co/guide/en/logstash/current/jvm-settings.html#heap-size)

If a problem will exist, please explain your configuration input, filter, output to understand what's happening inside the pipeline.

---

<div class="post-metadata">

**Author:** ![tanveer14](https://avatars.discourse-cdn.com/v4/letter/t/e19b73/32.png) [@tanveer14](https://discuss.elastic.co/u/tanveer14)\
**Post date:** [August 14, 2023, 8:47am UTC](https://discuss.elastic.co/t/excessive-ram-usage-gets-oom-killed-in-logstash/340716/3 "2023-08-14T08:47:24Z")

</div>

I just set -Xms5g -Xmx5g but still pod is killed by OOM killer.  
whenever i run "ps -ef" command inside the container getting  
"/usr/share/logstash/jdk/bin/java -Xms1g -Xmx1g -Djava.awt.headless=true -Dfile.encodi" as output.

I am using HELM installation, so in my values.yaml i just set -Xms5g -Xmx5g  
so is there any configuration which will override this setup as in this case it should have set to 5gb which is not reflecting in JAVA process.

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [August 14, 2023, 8:30pm UTC](https://discuss.elastic.co/t/excessive-ram-usage-gets-oom-killed-in-logstash/340716/4 "2023-08-14T20:30:33Z")

</div>

Should be under [logstashJavaOpts](https://github.com/elastic/helm-charts/blob/2fd64d0af65f14df7aa01da591919460dabac4b3/logstash/values.yaml#L83C1-L84C1)

---

<div class="post-metadata">

**Author:** ![tanveer14](https://avatars.discourse-cdn.com/v4/letter/t/e19b73/32.png) [@tanveer14](https://discuss.elastic.co/u/tanveer14)\
**Post date:** [August 16, 2023, 9:05am UTC](https://discuss.elastic.co/t/excessive-ram-usage-gets-oom-killed-in-logstash/340716/5 "2023-08-16T09:05:30Z")

</div>

We changed at same location but it's not reflecting when process start.

---

<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:** [September 13, 2023, 9:06am UTC](https://discuss.elastic.co/t/excessive-ram-usage-gets-oom-killed-in-logstash/340716/6 "2023-09-13T09:06:10Z")

</div>

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