# Filebeat High Memory Usage with multiline.negate=true

**URL:** <https://discuss.elastic.co/t/filebeat-high-memory-usage-with-multiline-negate-true/169291>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [February 20, 2019, 8:50pm UTC](https://discuss.elastic.co/t/filebeat-high-memory-usage-with-multiline-negate-true/169291 "2019-02-20T20:50:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![derekcal](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@derekcal](https://discuss.elastic.co/u/derekcal)\
**Post date:** [February 20, 2019, 8:50pm UTC](https://discuss.elastic.co/t/filebeat-high-memory-usage-with-multiline-negate-true/169291/1 "2019-02-20T20:50:39Z")

</div>

I am running filebeat 6.2.3 and something I noticed is when I have a multiline pattern set and multiline.negate=true, I experience high memory usage.

Set multiline.negate=true 2:38 PM

11804 root 20 0 45.2g 4.4g 10m S 0.3 2.3 5513:48 filebeat

Set multiline.negate=false 2:42 PM

38722 root 20 0 329m 43m 9892 S 7.9 0.0 0:13.35 filebeat

Is there a reason setting multiline.negate=true would cause high memory usage?

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [February 21, 2019, 2:34pm UTC](https://discuss.elastic.co/t/filebeat-high-memory-usage-with-multiline-negate-true/169291/2 "2019-02-21T14:34:19Z")

</div>

Memory usage depends on the number of files processed concurrently, queue size (default 4096 events), and the event sizes themselves. Multiline events are bigger by nature, so requiring more memory. Reason `multiline.negate: true` requires more memory is, because many more lines are captured into one event.  
If your pattern is ill defined and captures the complete file by accident you might end up with very high memory usage.

---

<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:** [March 21, 2019, 2:48pm UTC](https://discuss.elastic.co/t/filebeat-high-memory-usage-with-multiline-negate-true/169291/3 "2019-03-21T14:48:41Z")

</div>

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