# Mlockall fails

**URL:** <https://discuss.elastic.co/t/mlockall-fails/11453>\
**Category:** Elasticsearch\
**Created:** [April 4, 2013, 3:55pm UTC](https://discuss.elastic.co/t/mlockall-fails/11453 "2013-04-04T15:55:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ophir\_Michaeli](https://avatars.discourse-cdn.com/v4/letter/o/9f8e36/32.png) [@Ophir\_Michaeli](https://discuss.elastic.co/u/Ophir_Michaeli)\
**Post date:** [April 4, 2013, 3:55pm UTC](https://discuss.elastic.co/t/mlockall-fails/11453/1 "2013-04-04T15:55:52Z")

</div>

Hi,

I set "bootstrap.mlockall = true" at elasticsearch.yml and added  
"common.jna: DEBUG " at config.yml.

At logs\ pinterest\_cluster.log I get the following message: " unable to  
link C library. native methods (mlockall) will be disabled".

Any idea how to solve this?

Thanks

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [April 4, 2013, 4:34pm UTC](https://discuss.elastic.co/t/mlockall-fails/11453/2 "2013-04-04T16:34:01Z")

</div>

Which operating system an architecture is this?

One idea to solve this: check if your OS / security subsystem allows  
loading of shared libraries from the file system you have installed ES on.

Jörg

Am 04.04.13 17:55, schrieb Ophir Michaeli:

> Hi,
> 
> I set "bootstrap.mlockall = true" at elasticsearch.yml and added  
> "common.jna: DEBUG " at config.yml.
> 
> At logs\pinterest\_cluster.log I get the following message: "unable to  
> link C library. native methods (mlockall) will be disabled".
> 
> Any idea how to solve this?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ophir\_Michaeli](https://avatars.discourse-cdn.com/v4/letter/o/9f8e36/32.png) [@Ophir\_Michaeli](https://discuss.elastic.co/u/Ophir_Michaeli)\
**Post date:** [April 4, 2013, 4:40pm UTC](https://discuss.elastic.co/t/mlockall-fails/11453/3 "2013-04-04T16:40:34Z")

</div>

Windows server 2008 R2, 64bit.

How do I check if my OS / security subsystem allows  
loading of shared libraries from the file system I installed ES on?

Thanks J

On Thursday, April 4, 2013 6:55:52 PM UTC+3, Ophir Michaeli wrote:

> Hi,
> 
> I set "bootstrap.mlockall = true" at elasticsearch.yml and added  
> "common.jna: DEBUG " at config.yml.
> 
> At logs\ pinterest\_cluster.log I get the following message: " unable to  
> link C library. native methods (mlockall) will be disabled".
> 
> Any idea how to solve this?
> 
> Thanks

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [April 4, 2013, 7:05pm UTC](https://discuss.elastic.co/t/mlockall-fails/11453/4 "2013-04-04T19:05:49Z")

</div>

There is no mlockall() call in WIndows. It's UNIX/Linux only.

Jörg

Am 04.04.13 18:40, schrieb Ophir Michaeli:

> Windows server 2008 R2, 64bit.
> 
> How do I check if my OS / security subsystem allows  
> loading of shared libraries from the file system I installed ES on?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ophir\_Michaeli](https://avatars.discourse-cdn.com/v4/letter/o/9f8e36/32.png) [@Ophir\_Michaeli](https://discuss.elastic.co/u/Ophir_Michaeli)\
**Post date:** [April 7, 2013, 7:55am UTC](https://discuss.elastic.co/t/mlockall-fails/11453/5 "2013-04-07T07:55:26Z")

</div>

Thanks, at the elasticsearch documentation it doesn't say it's for  
Unix/Linux only:

"

Memory Settings

There is an option to use _mlockall_[http://opengroup.org/onlinepubs/007908799/xsh/mlockall.html](http://opengroup.org/onlinepubs/007908799/xsh/mlockall.html)to try and lock the process address space so it won’t be swapped. For this  
to work, the bootstrap.mlockall should be set to true and it is recommended  
to set both the min and max memory allocation to be the same.

In order to see if this works or not, set the common.jna logging to DEBUG  
level. A solution to “Unknown mlockall error 0” can be to set ulimit -l  
unlimited.

Note, this is experimental feature, and might cause the JVM or shell  
session to exit if failing to allocate the memory (because not enough  
memory is available on the machine).

"

On Thursday, April 4, 2013 10:05:49 PM UTC+3, Jörg Prante wrote:

> There is no mlockall() call in WIndows. It's UNIX/Linux only.
> 
> Jörg
> 
> Am 04.04.13 18:40, schrieb Ophir Michaeli:
> 
> > Windows server 2008 R2, 64bit.
> > 
> > How do I check if my OS / security subsystem allows  
> > loading of shared libraries from the file system I installed ES on?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [April 7, 2013, 10:48am UTC](https://discuss.elastic.co/t/mlockall-fails/11453/6 "2013-04-07T10:48:44Z")

</div>

On Sunday, April 7, 2013 9:55:26 AM UTC+2, Ophir Michaeli wrote:

> Thanks, at the elasticsearch documentation it doesn't say it's for  
> Unix/Linux only:

I added a note to the website  
([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/setup/installation/)) that  
states that it is only available on linux / unix

simon

> "
> 
> Memory Settings
> 
> There is an option to use _mlockall_[http://opengroup.org/onlinepubs/007908799/xsh/mlockall.html](http://opengroup.org/onlinepubs/007908799/xsh/mlockall.html)to try and lock the process address space so it won’t be swapped. For this  
> to work, the bootstrap.mlockall should be set to true and it is recommended  
> to set both the min and max memory allocation to be the same.
> 
> In order to see if this works or not, set the common.jna logging to DEBUG  
> level. A solution to “Unknown mlockall error 0” can be to set ulimit -l  
> unlimited.
> 
> Note, this is experimental feature, and might cause the JVM or shell  
> session to exit if failing to allocate the memory (because not enough  
> memory is available on the machine).
> 
> "
> 
> On Thursday, April 4, 2013 10:05:49 PM UTC+3, Jörg Prante wrote:
> 
> > There is no mlockall() call in WIndows. It's UNIX/Linux only.
> > 
> > Jörg
> > 
> > Am 04.04.13 18:40, schrieb Ophir Michaeli:
> > 
> > > Windows server 2008 R2, 64bit.
> > > 
> > > How do I check if my OS / security subsystem allows  
> > > loading of shared libraries from the file system I installed ES on?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![timbunce](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timbunce/32/44945_2.png) [@timbunce](https://discuss.elastic.co/u/timbunce)\
**Post date:** [April 8, 2013, 9:35am UTC](https://discuss.elastic.co/t/mlockall-fails/11453/7 "2013-04-08T09:35:56Z")

</div>

On Sun, Apr 07, 2013 at 03:48:44AM -0700, simonw wrote:

> On Sunday, April 7, 2013 9:55:26 AM UTC+2, Ophir Michaeli wrote:
> 
> ```
> Thanks, at the elasticsearch documentation it doesn't say it's for Unix/Linux only:
> 
> ```
> 
> I added a note to the website ([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/setup/installation/)) that  
> states that it is only available on linux / unix  
> simon
> 
> ```
> "
> Memory Settings
> 
> There is an option to use [1]mlockall to try and lock the process address space so it won’t be
> swapped. For this to work, the bootstrap.mlockall should be set to true and it is recommended to set
> both the min and max memory allocation to be the same.
> 
> In order to see if this works or not, set the common.jna logging to DEBUG level. A solution to
> “Unknown mlockall error 0” can be to set ulimit -l unlimited.
> 
> Note, this is experimental feature, and might cause the JVM or shell session to exit if failing to
> allocate the memory (because not enough memory is available on the machine).
> "
> 
> ```

It would be worth also pointing out that mlockall is not effective in a  
virtualized environment. The guest O/S can lock the pages, but that  
doesn't stop the host O/S stealing them for other processes/VMs.

Tim.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [April 8, 2013, 7:01pm UTC](https://discuss.elastic.co/t/mlockall-fails/11453/8 "2013-04-08T19:01:22Z")

</div>

Hi Tim

> It would be worth also pointing out that mlockall is not effective in a  
> virtualized environment. The guest O/S can lock the pages, but that  
> doesn't stop the host O/S stealing them for other processes/VMs.

I know that mlockall isn't supported in Qemu, but is the above true for  
Xen based VMs as well?

clint

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:42am UTC](https://discuss.elastic.co/t/mlockall-fails/11453/9 "2017-07-06T02:42:12Z")

</div>


