# Dealing with gzipped multilined log files (memory problems)

**URL:** <https://discuss.elastic.co/t/dealing-with-gzipped-multilined-log-files-memory-problems/26538>\
**Category:** Logstash\
**Created:** [July 30, 2015, 3:13am UTC](https://discuss.elastic.co/t/dealing-with-gzipped-multilined-log-files-memory-problems/26538 "2015-07-30T03:13:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Win\_Wang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/win_wang/32/674_2.png) [@Win\_Wang](https://discuss.elastic.co/u/Win_Wang)\
**Post date:** [July 30, 2015, 3:13am UTC](https://discuss.elastic.co/t/dealing-with-gzipped-multilined-log-files-memory-problems/26538/1 "2015-07-30T03:13:14Z")

</div>

I used an exec input with a command to parse the topmost file in a directory every x seconds via zcat (deleting it after I finish), then use the multiline codec to parse it line by line into a json format. I should mention these .gz files are ~4mb in size.

When I parse the first file, logstash is sitting around 270mb of ram usage (and steadily increases by ~10kb per second). Once I hit the second file, logstash spikes to over 400mb, and I would assume continues to increase for the next files.

Why is this and how do I stop it?

---

<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, 5:33am UTC](https://discuss.elastic.co/t/dealing-with-gzipped-multilined-log-files-memory-problems/26538/2 "2017-07-06T05:33:24Z")

</div>


