# What is use of setting mlockall to true?

**URL:** <https://discuss.elastic.co/t/what-is-use-of-setting-mlockall-to-true/54138>\
**Category:** Elasticsearch\
**Created:** [June 28, 2016, 9:43am UTC](https://discuss.elastic.co/t/what-is-use-of-setting-mlockall-to-true/54138 "2016-06-28T09:43:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeevan\_jeevanreddy](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@jeevan\_jeevanreddy](https://discuss.elastic.co/u/jeevan_jeevanreddy)\
**Post date:** [June 28, 2016, 9:43am UTC](https://discuss.elastic.co/t/what-is-use-of-setting-mlockall-to-true/54138/1 "2016-06-28T09:43:11Z")

</div>

which performance metric gets improved by bootstrap.mlockall:true( disables swapping) in config file?

---

<div class="post-metadata">

**Author:** ![rmuir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rmuir/32/44949_2.png) [@rmuir](https://discuss.elastic.co/u/rmuir)\
**Post date:** [June 28, 2016, 9:47am UTC](https://discuss.elastic.co/t/what-is-use-of-setting-mlockall-to-true/54138/2 "2016-06-28T09:47:25Z")

</div>

The RAM waste metric 🙂

I recommend against setting this myself.

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [June 28, 2016, 2:10pm UTC](https://discuss.elastic.co/t/what-is-use-of-setting-mlockall-to-true/54138/3 "2016-06-28T14:10:51Z")

</div>

It locks the initial JVM heap in memory, which means that it will always sit resident in physical RAM. This can help reduce garbage collection pause times (a terrible thing that can happen is the heap is swapped out, then a full garbage collection is initiated and the JVM must touch every page of the heap leading to massive disk I/O). There are other ways to reduce the propensity to swap, and this is but one of them.

---

<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, 10:39pm UTC](https://discuss.elastic.co/t/what-is-use-of-setting-mlockall-to-true/54138/4 "2017-07-05T22:39:53Z")

</div>


