# Elasticserach 7.2 Unable to create cluster with error "Unable to lock JVM Memory: error=12, reason=Cannot allocate memory"

**URL:** <https://discuss.elastic.co/t/elasticserach-7-2-unable-to-create-cluster-with-error-unable-to-lock-jvm-memory-error-12-reason-cannot-allocate-memory/252050>\
**Category:** Elasticsearch\
**Created:** [October 14, 2020, 1:31pm UTC](https://discuss.elastic.co/t/elasticserach-7-2-unable-to-create-cluster-with-error-unable-to-lock-jvm-memory-error-12-reason-cannot-allocate-memory/252050 "2020-10-14T13:31:16Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [October 14, 2020, 1:53pm UTC](https://discuss.elastic.co/t/elasticserach-7-2-unable-to-create-cluster-with-error-unable-to-lock-jvm-memory-error-12-reason-cannot-allocate-memory/252050/4 "2020-10-14T13:53:24Z")

</div>

The problem is that you have set `bootstrap.memory_lock: true` but your system does not support memory locking. The solution is therefore not to set `bootstrap.memory_lock: true`. Instead you should [disable swap](https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration-memory.html).

---

_[View the full topic](https://discuss.elastic.co/t/elasticserach-7-2-unable-to-create-cluster-with-error-unable-to-lock-jvm-memory-error-12-reason-cannot-allocate-memory/252050)._
