# Gc overhead while index data using logstash

**URL:** <https://discuss.elastic.co/t/gc-overhead-while-index-data-using-logstash/171268>\
**Category:** Elasticsearch\
**Created:** [March 7, 2019, 10:16am UTC](https://discuss.elastic.co/t/gc-overhead-while-index-data-using-logstash/171268 "2019-03-07T10:16:55Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Janko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/janko/32/26896_2.png) [@Janko](https://discuss.elastic.co/u/Janko)\
**Post date:** [March 22, 2019, 10:50am UTC](https://discuss.elastic.co/t/gc-overhead-while-index-data-using-logstash/171268/9 "2019-03-22T10:50:26Z")

</div>

Hey Rajesh, sorry for the late reply, I've been off for a while.

The recommendations for JVM heap configuration in Elasticsearch are generally based on having the service running exclusively on the node. You can find an in depth discussion about the parameters and configuration at [https://www.elastic.co/blog/a-heap-of-trouble](https://www.elastic.co/blog/a-heap-of-trouble). Be sure to stick to around `31 GB` max to avoid the uncompressed memory pointers.

Regarding the Logstash performance issues we have guidance on how to look into this further available at [https://www.elastic.co/guide/en/logstash/current/performance-troubleshooting.html](https://www.elastic.co/guide/en/logstash/current/performance-troubleshooting.html) and [https://www.elastic.co/guide/en/logstash/master/tuning-logstash.html](https://www.elastic.co/guide/en/logstash/master/tuning-logstash.html).

What you describe sounds a bit like it might be either Logstash or Elasticsearch running out of memory and garbage collecting.  
There are some considerations around this as well in [https://discuss.elastic.co/t/logstash-heap-size-vs-elasticsearch-heap-size/133662](https://discuss.elastic.co/t/logstash-heap-size-vs-elasticsearch-heap-size/133662).

Ideally you would like to separate both services and configure each node individually along the best practices given in the linked documentation.

All the best

---

_[View the full topic](https://discuss.elastic.co/t/gc-overhead-while-index-data-using-logstash/171268)._
