# Elasticsearch is not starting when bootstrap.memory\_lock is set to true

**URL:** <https://discuss.elastic.co/t/elasticsearch-is-not-starting-when-bootstrap-memory-lock-is-set-to-true/120962>\
**Category:** Elasticsearch\
**Created:** [February 22, 2018, 1:59am UTC](https://discuss.elastic.co/t/elasticsearch-is-not-starting-when-bootstrap-memory-lock-is-set-to-true/120962 "2018-02-22T01:59:12Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![amruth](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@amruth](https://discuss.elastic.co/u/amruth)\
**Post date:** [February 22, 2018, 3:18pm UTC](https://discuss.elastic.co/t/elasticsearch-is-not-starting-when-bootstrap-memory-lock-is-set-to-true/120962/13 "2018-02-22T15:18:32Z")

</div>

One last question - Where to set JVM heap size? There are two locations in jvm.options file,

```
## 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:
##
-Xms16g
-Xmx16g
##
## 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

-Xms2g
-Xmx2g

```

Can you please say where I need to set, the top one or the bottom one?

---

_[View the full topic](https://discuss.elastic.co/t/elasticsearch-is-not-starting-when-bootstrap-memory-lock-is-set-to-true/120962)._
