# Elasticsearch 5.1.x bootstrap check failed heap size

**URL:** <https://discuss.elastic.co/t/elasticsearch-5-1-x-bootstrap-check-failed-heap-size/71386>\
**Category:** Elasticsearch\
**Created:** [January 12, 2017, 2:23pm UTC](https://discuss.elastic.co/t/elasticsearch-5-1-x-bootstrap-check-failed-heap-size/71386 "2017-01-12T14:23:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mudim](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@mudim](https://discuss.elastic.co/u/mudim)\
**Post date:** [January 12, 2017, 2:23pm UTC](https://discuss.elastic.co/t/elasticsearch-5-1-x-bootstrap-check-failed-heap-size/71386/1 "2017-01-12T14:23:10Z")

</div>

Hi,  
Am running into issues trying to get my ES cluster up and running when on non-local host settings. Getting bootstrap failures with  
**initial heap size [33554432] not equal to maximum heap size [524288000]; this can cause resize pauses and prevents mlockall from locking the entire heap**

I understand the nature of these errors and have changed configuration (jvm.opts) to have equal sizes of 2g. That hasn't done any good. Still the same error with same mismatch values.

Out of curiosity, ran **java -XX:+PrintFlagsFinal -version | grep HeapSize** and got below output

uintx ErgoHeapSizeLimit = 0 {product}  
uintx HeapSizePerGCThread = 87241520 {product}  
uintx InitialHeapSize := 33554432 {product}  
uintx LargePageHeapSizeThreshold = 134217728 {product}  
uintx MaxHeapSize := 524288000 {product}

As you can see, these numbers match to the error I am getting. Which means ES server is ignoring jvm.opts and picking those values from somewhere else. So, thought explicitly setting **JAVA\_TOOL\_OPTIONS** might help. And, so I did by setting both (-Xmx and -Xms) to 2g.

However, when I try and start the server, still the same error as before (shows the same min/max values).  
Curious as to where these values are being picked up from ?

This really is a blocker if the settings aren't read as expected from the relevant sources. Would really appreciate if someone could point me in a direction that I might've missed configuring.

Cheers.

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [January 12, 2017, 2:38pm UTC](https://discuss.elastic.co/t/elasticsearch-5-1-x-bootstrap-check-failed-heap-size/71386/2 "2017-01-12T14:38:24Z")

</div>

Which distribution of elasticsearch are you installing (zip, tar, deb or rpm)? Note that for deb and rpm installations `jvm.options` needs to be located in `/etc/elasticsearch/jvm.options` and for zip or tar installations it needs to be located in `config/jvm.options` relative to the directory you unzipped elasticsearch into. More infor can be found here: [https://www.elastic.co/guide/en/elasticsearch/reference/current/setting-system-settings.html#jvm-options](https://www.elastic.co/guide/en/elasticsearch/reference/current/setting-system-settings.html#jvm-options)

Also note that you can set JVM options via the environment variable `ES_JAVA_OPTS` (I'm not sure if `JAVA_TOOL_OPTIONS` will be picked up but `ES_JAVA_OPTS` should definitely be picked up). More information on this can be found at the bottom of this page: [https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html)

Hope that helps

---

<div class="post-metadata">

**Author:** ![mudim](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@mudim](https://discuss.elastic.co/u/mudim)\
**Post date:** [January 12, 2017, 3:01pm UTC](https://discuss.elastic.co/t/elasticsearch-5-1-x-bootstrap-check-failed-heap-size/71386/3 "2017-01-12T15:01:07Z")

</div>

Hi,  
Thanks for taking time and responding.  
It's a deb package on EC2 and I did have jvm.options in /etc/elasticsearch. Turns out the elasticsearch-ansible role am using is deleting the default config and loading the jvm.options in to /etc/elasticsearch/{{instanceId}}. Is there anyway I can configure ES to look at a diff place for jvm.options ?

Cheers.

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [January 12, 2017, 3:34pm UTC](https://discuss.elastic.co/t/elasticsearch-5-1-x-bootstrap-check-failed-heap-size/71386/4 "2017-01-12T15:34:39Z")

</div>

You can set the environment variable `ES_JVM_OPTIONS` to be the path to file containing JVM options

---

<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:** [February 9, 2017, 3:34pm UTC](https://discuss.elastic.co/t/elasticsearch-5-1-x-bootstrap-check-failed-heap-size/71386/5 "2017-02-09T15:34:50Z")

</div>

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