# Logstash exec input constantly runs out of memory

**URL:** <https://discuss.elastic.co/t/logstash-exec-input-constantly-runs-out-of-memory/182719>\
**Category:** Logstash\
**Created:** [May 24, 2019, 7:40pm UTC](https://discuss.elastic.co/t/logstash-exec-input-constantly-runs-out-of-memory/182719 "2019-05-24T19:40:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lgwapnitsky](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lgwapnitsky/32/42919_2.png) [@lgwapnitsky](https://discuss.elastic.co/u/lgwapnitsky)\
**Post date:** [May 24, 2019, 7:40pm UTC](https://discuss.elastic.co/t/logstash-exec-input-constantly-runs-out-of-memory/182719/1 "2019-05-24T19:40:12Z")

</div>

I'm running a very simple, timestamp-based bash script under logstash's exec input. After a few hours, I stop receiving data, and the following appears in the log

```
[ERROR][logstash.inputs.exec] Error while running command {:command=>"/etc/logstash/scripts/cf_edge_poll.sh", :e=>#<Errno::ENOMEM: Cannot all
ocate memory - /etc/logstash/scripts/cf_edge_poll.sh>, :backtrace=>["org/jruby/RubyIO.java:3999:in `popen'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-i
nput-exec-3.3.2/lib/logstash/inputs/exec.rb:97:in `run_command'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-exec-3.3.2/lib/logstash/inputs/exec.rb
:71:in `execute'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-exec-3.3.2/lib/logstash/inputs/exec.rb:47:in `block in run'", "/usr/share/logstash/ve
ndor/bundle/jruby/2.5.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:234:in `do_call'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/rufus-scheduler-3.0.9
/lib/rufus/scheduler/jobs.rb:258:in `do_trigger'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:300:in `block in s
tart_work_thread'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:299:in `block in start_work_thread'", "org/jruby/
RubyKernel.java:1425:in `loop'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:289:in `block in start_work_thread'"
]}

```

The system is running in Azure, 14GB memory, with 7GB max on java settings.

Updating to the latest version does not help.

Advice is welcome.

---

<div class="post-metadata">

**Author:** ![lgwapnitsky](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lgwapnitsky/32/42919_2.png) [@lgwapnitsky](https://discuss.elastic.co/u/lgwapnitsky)\
**Post date:** [June 3, 2019, 6:04pm UTC](https://discuss.elastic.co/t/logstash-exec-input-constantly-runs-out-of-memory/182719/2 "2019-06-03T18:04:55Z")

</div>

Updated heap memory, still the same results. Advice is welcome.

Thank you

---

<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 1, 2019, 6:05pm UTC](https://discuss.elastic.co/t/logstash-exec-input-constantly-runs-out-of-memory/182719/3 "2019-07-01T18:05:01Z")

</div>

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