# Setting heap size on JVM.options . still getting heap size problem

**URL:** <https://discuss.elastic.co/t/setting-heap-size-on-jvm-options-still-getting-heap-size-problem/89341>\
**Category:** Elasticsearch\
**Created:** [June 14, 2017, 9:11am UTC](https://discuss.elastic.co/t/setting-heap-size-on-jvm-options-still-getting-heap-size-problem/89341 "2017-06-14T09:11:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saurab\_Dahal](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@Saurab\_Dahal](https://discuss.elastic.co/u/Saurab_Dahal)\
**Post date:** [June 14, 2017, 9:11am UTC](https://discuss.elastic.co/t/setting-heap-size-on-jvm-options-still-getting-heap-size-problem/89341/1 "2017-06-14T09:11:02Z")

</div>

Here is a part of my JVM.options file that sets heap size  
## JVM configuration

```
################################################################
## IMPORTANT: JVM heap size
################################################################
##
## You should always set the min and max JVM heap
## size to the same value. For example, to set
## the heap to 4 GB, set:
##
 -Xms2g
 -Xmx2g
##
## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html
## for more information
##
################################################################

# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space

##-Xms1g
##-Xmx1g

```

Eventhougn the -Xms and -Xmx values are same, I am still getting this error

```
publish_address {10.10.10.131:9300}, bound_addresses {10.10.10.131:9300}
[2017-06-14T14:50:07,117][INFO][o.e.b.BootstrapChecks] [node1] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
ERROR: [2] bootstrap checks failed
[1]: initial heap size [130023424] not equal to maximum heap size [2069889024]; this can cause resize pauses and prevents mlockall from locking the entire heap
[2]: memory locking requested for elasticsearch process but memory is not locked
[2017-06-14T14:50:07,127][INFO][o.e.n.Node] [node1] stopping ...
[2017-06-14T14:50:07,204][INFO][o.e.n.Node] [node1] stopped
[2017-06-14T14:50:07,204][INFO][o.e.n.Node] [node1] closing ...
[2017-06-14T14:50:07,222][INFO][o.e.n.Node] [node1] closed
[2017-06-14T14:50:07,225][INFO][o.e.x.m.j.p.NativeController] Native controller process has stopped - no new native processes can be started

```

What am I doing wrong ?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 14, 2017, 10:07am UTC](https://discuss.elastic.co/t/setting-heap-size-on-jvm-options-still-getting-heap-size-problem/89341/2 "2017-06-14T10:07:22Z")

</div>

May be something else (env var) is setting that heap size?

I'd remove spaces in front of the 2 lines BTW

---

<div class="post-metadata">

**Author:** ![Saurab\_Dahal](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@Saurab\_Dahal](https://discuss.elastic.co/u/Saurab_Dahal)\
**Post date:** [June 14, 2017, 10:11am UTC](https://discuss.elastic.co/t/setting-heap-size-on-jvm-options-still-getting-heap-size-problem/89341/3 "2017-06-14T10:11:27Z")

</div>

thanks, removing spaces solved heap problem but this problem still persists  
`memory locking requested for elasticsearch process but memory is not locked`  
my limits.conf file has following lines also  
`elasticsearch soft memlock unlimited elasticsearch hard memlock unlimited`

---

<div class="post-metadata">

**Author:** ![willJackson](https://avatars.discourse-cdn.com/v4/letter/w/958977/32.png) [@willJackson](https://discuss.elastic.co/u/willJackson)\
**Post date:** [June 23, 2017, 7:59am UTC](https://discuss.elastic.co/t/setting-heap-size-on-jvm-options-still-getting-heap-size-problem/89341/4 "2017-06-23T07:59:58Z")

</div>

> [@Saurab\_Dahal](#):
>
> my limits.conf file has following lines also

do you solve it yet?i meet this problem also.

---

<div class="post-metadata">

**Author:** ![Saurab\_Dahal](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@Saurab\_Dahal](https://discuss.elastic.co/u/Saurab_Dahal)\
**Post date:** [July 9, 2017, 11:07am UTC](https://discuss.elastic.co/t/setting-heap-size-on-jvm-options-still-getting-heap-size-problem/89341/5 "2017-07-09T11:07:46Z")

</div>

@willJackson if you have not solved it yet, then instead of elasticsearch in  
elasticsearch soft memlock unlimited  
elasticsearch hard memlock unlimited  
write your username name. that solved for me

---

<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:** [August 6, 2017, 11:07am UTC](https://discuss.elastic.co/t/setting-heap-size-on-jvm-options-still-getting-heap-size-problem/89341/6 "2017-08-06T11:07:55Z")

</div>

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