# Logstash Memory grows unlimited

**URL:** <https://discuss.elastic.co/t/logstash-memory-grows-unlimited/271757>\
**Category:** Logstash\
**Created:** [April 30, 2021, 9:52am UTC](https://discuss.elastic.co/t/logstash-memory-grows-unlimited/271757 "2021-04-30T09:52:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![KaustavNath](https://avatars.discourse-cdn.com/v4/letter/k/4da419/32.png) [@KaustavNath](https://discuss.elastic.co/u/KaustavNath)\
**Post date:** [April 30, 2021, 9:52am UTC](https://discuss.elastic.co/t/logstash-memory-grows-unlimited/271757/1 "2021-04-30T09:52:43Z")

</div>

Hello,  
I am using Logstash version 6.8.3. Recently I face issue with memory in logstash in the pipeline for beat tcp input. In the log I have below error  
"Caused by: java.lang.IndexOutOfBoundsException: writerIndex(2147483437) + minWritableBytes(512) exceeds maxCapacity(2147483647): PooledUnsafeDirectByteBuf(ridx: 0, widx: 2147483437, cap: 2147483647)  
Suppressed: java.lang.IndexOutOfBoundsException: writerIndex(2147483437) + minWritableBytes(512) exceeds maxCapacity(2147483647): PooledUnsafeDirectByteBuf(ridx: 0, widx: 2147483437, cap: 2147483647)"

After 1 hour the memory reaches to around 30 GB and the server memory reaches 100% and Logstash gets hung. I am using Heap size as 16 GB. There is a load balancer above the Logstash machines. I am using in memory queue wiith batch.size as 500 and 5 workers. The issue suddenly stops happening for 4-5 days and then again the same issue starts and keeps happening for dayss.

---

<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:** [May 28, 2021, 9:53am UTC](https://discuss.elastic.co/t/logstash-memory-grows-unlimited/271757/2 "2021-05-28T09:53:03Z")

</div>

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