# JVM Heap space recommendation on 7.11.2

**URL:** <https://discuss.elastic.co/t/jvm-heap-space-recommendation-on-7-11-2/268017>\
**Category:** Elasticsearch\
**Created:** [March 22, 2021, 8:48pm UTC](https://discuss.elastic.co/t/jvm-heap-space-recommendation-on-7-11-2/268017 "2021-03-22T20:48:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![vee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vee/32/55759_2.png) [@vee](https://discuss.elastic.co/u/vee)\
**Post date:** [March 22, 2021, 8:48pm UTC](https://discuss.elastic.co/t/jvm-heap-space-recommendation-on-7-11-2/268017/1 "2021-03-22T20:48:30Z")

</div>

Hi, am planning to upgrade elastic from v7.5 to v7.11.2. We currently have heapspace settings in jvm.options using the Xmx and Xms settings, and we do use the OpenJDK that comes with the product. Is the recommendation always to use the "automatic heap adjustement" that comes out of box with elastic, or override them manually through the jvm.options.d file?

I want to make sure that we don't cause any JVM outages if we rely on the automatic heap adjustments from elastic, if we know we have room to increase by manually overiding the setting.

> **[Important Elasticsearch configuration | Elasticsearch Reference \[7.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.11/important-settings.html#heap-size-settings)**

Thanks!

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 22, 2021, 8:50pm UTC](https://discuss.elastic.co/t/jvm-heap-space-recommendation-on-7-11-2/268017/2 "2021-03-22T20:50:53Z")

</div>

What sort of outages are you referring to here?

---

<div class="post-metadata">

**Author:** ![vee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vee/32/55759_2.png) [@vee](https://discuss.elastic.co/u/vee)\
**Post date:** [March 22, 2021, 8:55pm UTC](https://discuss.elastic.co/t/jvm-heap-space-recommendation-on-7-11-2/268017/3 "2021-03-22T20:55:19Z")

</div>

Running out of memory (OOM) exceptions, that we have seen recently in prod with the current v7.5. And we do have the Xms/x settings in jvm.options.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 22, 2021, 9:39pm UTC](https://discuss.elastic.co/t/jvm-heap-space-recommendation-on-7-11-2/268017/4 "2021-03-22T21:39:48Z")

</div>

If you are looking to upgrade to prevent these that's a good step, however looking at the root cause of them is a much better idea.

---

<div class="post-metadata">

**Author:** ![vee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vee/32/55759_2.png) [@vee](https://discuss.elastic.co/u/vee)\
**Post date:** [March 22, 2021, 9:51pm UTC](https://discuss.elastic.co/t/jvm-heap-space-recommendation-on-7-11-2/268017/5 "2021-03-22T21:51:19Z")

</div>

Yes, we are certainly looking into all aspects of fixing any shortcomings in the configurations. One of the concerns mentioned by elastic support was the circuit breaker bugs in v7.5 (esp. coordination & ingest nodes) which were fixed in 7.10 and above. However, I'm not entirely sure still if it's recommended to us the "automatic heap adjustment" feature in the newer JDK or rather just set the Xmx/Xmx and so thought to get an opinion here before I reach out to support.

Thanks

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 22, 2021, 9:56pm UTC](https://discuss.elastic.co/t/jvm-heap-space-recommendation-on-7-11-2/268017/6 "2021-03-22T21:56:42Z")

</div>

Automatic heap adjustment happens on startup, it's not a constant thing once the JVM has initialised.

Personally, I would suggest it's useful for dev environments, but not for production.

---

<div class="post-metadata">

**Author:** ![vee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vee/32/55759_2.png) [@vee](https://discuss.elastic.co/u/vee)\
**Post date:** [March 22, 2021, 10:05pm UTC](https://discuss.elastic.co/t/jvm-heap-space-recommendation-on-7-11-2/268017/7 "2021-03-22T22:05:32Z")

</div>

Ah ok, that's good to know. It's misleading as the documentation says "We recommend this default sizing for most production environments". Thanks for the input, it helps.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 22, 2021, 10:10pm UTC](https://discuss.elastic.co/t/jvm-heap-space-recommendation-on-7-11-2/268017/8 "2021-03-22T22:10:32Z")

</div>

It's not misleading, like I said that's my personal preference.

---

<div class="post-metadata">

**Author:** ![vee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vee/32/55759_2.png) [@vee](https://discuss.elastic.co/u/vee)\
**Post date:** [March 23, 2021, 2:27am UTC](https://discuss.elastic.co/t/jvm-heap-space-recommendation-on-7-11-2/268017/9 "2021-03-23T02:27:34Z")

</div>

Got it. Thanks Mark.

---

<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:** [April 20, 2021, 2:28am UTC](https://discuss.elastic.co/t/jvm-heap-space-recommendation-on-7-11-2/268017/10 "2021-04-20T02:28:04Z")

</div>

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