# How to set the heap-size reasonably

**URL:** <https://discuss.elastic.co/t/how-to-set-the-heap-size-reasonably/201168>\
**Category:** Elasticsearch\
**Created:** [September 26, 2019, 7:29am UTC](https://discuss.elastic.co/t/how-to-set-the-heap-size-reasonably/201168 "2019-09-26T07:29:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yeziblo](https://avatars.discourse-cdn.com/v4/letter/y/74df32/32.png) [@yeziblo](https://discuss.elastic.co/u/yeziblo)\
**Post date:** [September 26, 2019, 7:29am UTC](https://discuss.elastic.co/t/how-to-set-the-heap-size-reasonably/201168/1 "2019-09-26T07:29:05Z")

</div>

Hi everyone, I'm new for elasticsearch and I know that the ES Heap-size is usually 50% of my physical RAM and cannot exceed 32GB.

My 1st question is, if my physical RAM has only 32GB, and there are other programs running on the server besides ES, how can I properly set the heap-size(Is it still set to 50% of 32GB)?

My 2nd question is that lucene will use off-heap, so whether the appropriate reduction of heap-size will improve the query speed of ES (because lucene can use more memory).

My 3rd question is, what does heap-size and off-size do for ES?Is heap-size more responsible for index and off-size more responsible for query?

Best Regards!

---

<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:** [October 24, 2019, 7:29am UTC](https://discuss.elastic.co/t/how-to-set-the-heap-size-reasonably/201168/2 "2019-10-24T07:29:28Z")

</div>

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