# JVM Heap size larger than 32 GB

**URL:** https://discuss.elastic.co/t/jvm-heap-size-larger-than-32-gb/328869
**Category:** Elasticsearch
**Created:** [March 29, 2023, 9:52pm UTC](https://discuss.elastic.co/t/jvm-heap-size-larger-than-32-gb/328869 "2023-03-29T21:52:20Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Milad\_Heydariaan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/milad_heydariaan/32/116602_2.png) [@Milad\_Heydariaan](https://discuss.elastic.co/u/Milad_Heydariaan)
#### Post date: [March 29, 2023, 9:52pm UTC](https://discuss.elastic.co/t/jvm-heap-size-larger-than-32-gb/328869/1 "2023-03-29T21:52:20Z")

</div>

We have several machines with 512 GB of RAM and I wanted to know if we can set JVM heap size for Elasticsearch larger than 32 GB (up to 256 GB).

[This](https://www.elastic.co/guide/en/elasticsearch/reference/8.6/advanced-configuration.html#set-jvm-heap-size) page says we should keep the heap size below the threshold for compressed ordinary object pointers (oops).

However, I've found posts like [this](https://news.ycombinator.com/item?id=22396918), which suggest setting JVM heap size beyond 64 GB.

Is that something you recommend to avoid or is it still acceptable? What should I be aware of if we want to use up to 256 GB or RAM?

In general, what do you recommend for large clusters that require a total heap size larger than 3 TB?  
We have a limited number of bare metal machines with up to 512 GB of RAM and we currently run multiple Elasticsearch data nodes on each with 31 GB of JVM heap, but sharing I/O between nodes on the same machine can be the bottleneck sometimes.

---

<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 29, 2023, 10:25pm UTC](https://discuss.elastic.co/t/jvm-heap-size-larger-than-32-gb/328869/2 "2023-03-29T22:25:36Z")

</div>

What version are you running?

---

<div class="post-metadata">

### Author: ![Milad\_Heydariaan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/milad_heydariaan/32/116602_2.png) [@Milad\_Heydariaan](https://discuss.elastic.co/u/Milad_Heydariaan)
#### Post date: [March 29, 2023, 11:13pm UTC](https://discuss.elastic.co/t/jvm-heap-size-larger-than-32-gb/328869/3 "2023-03-29T23:13:20Z")

</div>

8.6.2

---

<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 29, 2023, 11:15pm UTC](https://discuss.elastic.co/t/jvm-heap-size-larger-than-32-gb/328869/4 "2023-03-29T23:15:12Z")

</div>

Ok so it uses G1GC which helps with larger heaps.

> [@Milad\_Heydariaan](#):
>
> We have a limited number of bare metal machines with up to 512 GB of RAM and we currently run multiple Elasticsearch data nodes on each with 31 GB of JVM heap, but sharing I/O between nodes on the same machine can be the bottleneck sometimes.

But putting more data on a single node doesn't negate that load, it just consolidates it.

Honestly, give it a go. Test your load profile. See what happens and if it works for your situation.

---

<div class="post-metadata">

### Author: ![Milad\_Heydariaan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/milad_heydariaan/32/116602_2.png) [@Milad\_Heydariaan](https://discuss.elastic.co/u/Milad_Heydariaan)
#### Post date: [March 30, 2023, 4:15pm UTC](https://discuss.elastic.co/t/jvm-heap-size-larger-than-32-gb/328869/5 "2023-03-30T16:15:23Z")

</div>

I understand the load would be consolidated, but is there a reason not to do that?  
I believe I/O sharing problem goes away by using a single node on each bare metal machine rather than multiple nodes competing for I/O bandwidth.

---

<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 30, 2023, 9:35pm UTC](https://discuss.elastic.co/t/jvm-heap-size-larger-than-32-gb/328869/6 "2023-03-30T21:35:11Z")

</div>

The flip side might happen, you might end up with a node that is under utilised.

---

<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 27, 2023, 9:35pm UTC](https://discuss.elastic.co/t/jvm-heap-size-larger-than-32-gb/328869/7 "2023-04-27T21:35:46Z")

</div>

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