# Memory or heap size

**URL:** <https://discuss.elastic.co/t/memory-or-heap-size/228886>\
**Category:** Logstash\
**Created:** [April 20, 2020, 2:29pm UTC](https://discuss.elastic.co/t/memory-or-heap-size/228886 "2020-04-20T14:29:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lynd](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@Lynd](https://discuss.elastic.co/u/Lynd)\
**Post date:** [April 20, 2020, 2:29pm UTC](https://discuss.elastic.co/t/memory-or-heap-size/228886/1 "2020-04-20T14:29:23Z")

</div>

What is ideal heap size of elastic search for nearly millions of records

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [April 20, 2020, 3:01pm UTC](https://discuss.elastic.co/t/memory-or-heap-size/228886/2 "2020-04-20T15:01:24Z")

</div>

That is an unanswerable question. The minimum heap size to process an arbitrarily large number of records is probably a couple of hundred megabytes, maybe half a gigabyte. Adding more memory may improve performance, but typically there are engineering trade-offs as increased memory can lead to increase GC costs.

The minimum will also depend on what filters you are using. Some filters (translate, dns, jdbc\_static, etc.) cache data in memory, and the amount of memory will depend on the amount of data.

Configure your filters, configure your heap, and benchmark it. If adding more memory improves performance and you can afford to add the memory then add it.

---

<div class="post-metadata">

**Author:** ![Lynd](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@Lynd](https://discuss.elastic.co/u/Lynd)\
**Post date:** [April 20, 2020, 3:03pm UTC](https://discuss.elastic.co/t/memory-or-heap-size/228886/3 "2020-04-20T15:03:31Z")

</div>

Thank you for your response.what is the maximum size we can set for heap size in elastic search?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [April 20, 2020, 3:10pm UTC](https://discuss.elastic.co/t/memory-or-heap-size/228886/5 "2020-04-20T15:10:03Z")

</div>

> [@Lynd](#):
>
> so can u pls suggest the RAM for Elasticsearch

No. The same applies. Test it and see what works best.

---

<div class="post-metadata">

**Author:** ![Lynd](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@Lynd](https://discuss.elastic.co/u/Lynd)\
**Post date:** [April 20, 2020, 3:17pm UTC](https://discuss.elastic.co/t/memory-or-heap-size/228886/6 "2020-04-20T15:17:57Z")

</div>

Also can u pls tell the maximum or threshold for setting heap size and am having the single node cluster

---

<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 18, 2020, 3:18pm UTC](https://discuss.elastic.co/t/memory-or-heap-size/228886/7 "2020-05-18T15:18:14Z")

</div>

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