# What is the recommended value for ES\_HEAP\_SIZE?

**URL:** https://discuss.elastic.co/t/what-is-the-recommended-value-for-es-heap-size/29772
**Category:** Elasticsearch
**Created:** [September 22, 2015, 10:29am UTC](https://discuss.elastic.co/t/what-is-the-recommended-value-for-es-heap-size/29772 "2015-09-22T10:29:53Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![r.ganeshbabu](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r.ganeshbabu](https://discuss.elastic.co/u/r.ganeshbabu)
#### Post date: [September 22, 2015, 10:29am UTC](https://discuss.elastic.co/t/what-is-the-recommended-value-for-es-heap-size/29772/1 "2015-09-22T10:29:53Z")

</div>

Hi,

We are planning to run **Elasticsearch 1.7 with Java 7** version and we have 3 Physical Servers.

Our proposed setup is as follows:-  
a. 3 Master Nodes (1 in each server)  
b 3 Client Nodes (1 in each server)  
c. 3 Data Nodes (1 in each server)

So, in total, we are planning to have **9 Nodes** running from 3 Physical Servers and our servers have **128 GB RAM**  
We understand **50 % of RAM size** (64 GB) is used by **OS** and  
1. We would like to know the recommended value for **ES\_HEAP\_SIZE** for Master node, Client node & Data node respectively?

Thanks,  
Ganesh

---

<div class="post-metadata">

### Author: ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)
#### Post date: [September 22, 2015, 2:02pm UTC](https://discuss.elastic.co/t/what-is-the-recommended-value-for-es-heap-size/29772/2 "2015-09-22T14:02:05Z")

</div>

We recommend that no single instance of Elasticsearch have more than a 30G heap allocated. The reasons are complex, but simplified it comes down to:

1. Shorter GC pauses

2. 32-bit pointers (exceeding this amount leads to 64-bit pointers, which yields a performance regression, and consumes more memory)

3. Oracle's java developers tested this number and gave us this recommendation. I figure that's a pretty good reason.

This means that with 128G boxes, you could have 2 instances of Elasticsearch running side-by-side on each box.

---

<div class="post-metadata">

### Author: ![n0othing](https://avatars.discourse-cdn.com/v4/letter/n/b2d939/32.png) [@n0othing](https://discuss.elastic.co/u/n0othing)
#### Post date: [September 22, 2015, 2:03pm UTC](https://discuss.elastic.co/t/what-is-the-recommended-value-for-es-heap-size/29772/3 "2015-09-22T14:03:26Z")

</div>

You could reasonably slice up memory like so:

a. Master node 16GB or less  
b. Client node 16GB or less  
c. [Data node 30.5GB](https://www.elastic.co/guide/en/elasticsearch/guide/current/heap-sizing.html#compressed_oops), do not go higher.

You'll probably need to do some experimenting with your master/client to see what works for your cluster. Also, try to [mlockall: true](https://www.elastic.co/guide/en/elasticsearch/guide/current/heap-sizing.html#_swapping_is_the_death_of_performance)

---

<div class="post-metadata">

### Author: ![r.ganeshbabu](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r.ganeshbabu](https://discuss.elastic.co/u/r.ganeshbabu)
#### Post date: [September 23, 2015, 4:43am UTC](https://discuss.elastic.co/t/what-is-the-recommended-value-for-es-heap-size/29772/4 "2015-09-23T04:43:31Z")

</div>

Thanks for your response. We will let know the feedback.

---

<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: [July 5, 2017, 11:48pm UTC](https://discuss.elastic.co/t/what-is-the-recommended-value-for-es-heap-size/29772/5 "2017-07-05T23:48:38Z")

</div>


