# Unable to lock JVM memory (ENOMEM)

**URL:** <https://discuss.elastic.co/t/unable-to-lock-jvm-memory-enomem/35749>\
**Category:** Elasticsearch\
**Created:** [November 27, 2015, 11:45am UTC](https://discuss.elastic.co/t/unable-to-lock-jvm-memory-enomem/35749 "2015-11-27T11:45:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Namita](https://avatars.discourse-cdn.com/v4/letter/n/bbce88/32.png) [@Namita](https://discuss.elastic.co/u/Namita)\
**Post date:** [November 27, 2015, 11:45am UTC](https://discuss.elastic.co/t/unable-to-lock-jvm-memory-enomem/35749/1 "2015-11-27T11:45:27Z")

</div>

I have recently started using elasticsearch. We(my company) use elasticsearch on postgres and its python client. I have installed marvel plugin and tried using it for a day. I suspended my laptop and next day I opened my laptop and reran elasticsearch. I am getting this error while starting the elasticsearch!

Unable to lock JVM memory (ENOMEM). This can result in part of the JVM being swapped out. Increase RLIMIT\_MEMLOCK (ulimit).

Below is the complete stacktrace.

[2015-11-27 13:22:47,567][WARN][bootstrap] Unable to lock JVM memory (ENOMEM). This can result in part of the JVM being swapped out. Increase RLIMIT\_MEMLOCK (ulimit).  
[2015-11-27 13:22:47,688][INFO][node] [Jonathan "John" Garrett] version[1.6.0], pid[5035], build[cdd3ac4/2015-06-09T13:36:34Z]  
[2015-11-27 13:22:47,688][INFO][node] [Jonathan "John" Garrett] initializing ...  
[2015-11-27 13:22:47,699][INFO][plugins] [Jonathan "John" Garrett] loaded [marvel], sites [marvel]  
[2015-11-27 13:22:47,756][INFO][env] [Jonathan "John" Garrett] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable\_space [77.4gb], net total\_space [454.4gb], types [ext4]  
[2015-11-27 13:22:51,029][INFO][node] [Jonathan "John" Garrett] initialized  
[2015-11-27 13:22:51,029][INFO][node] [Jonathan "John" Garrett] starting ...  
{1.6.0}: Startup Failed ...

- BindTransportException[Failed to bind to [9300-9400]]  
ChannelException[Failed to bind to: /121.0.0.1:9400]  
BindException[Cannot assign requested address]

---

<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:** [November 27, 2015, 4:09pm UTC](https://discuss.elastic.co/t/unable-to-lock-jvm-memory-enomem/35749/2 "2015-11-27T16:09:17Z")

</div>

Its not an error, its just a warning.

You asked to mlockall() the heap by configuring bootstrap.mlockall, but the call failed so it was not actually able to do that.

If you want to fix it, then you have to fix your system limits so that it is possible:

> The mlockall() function may fail if:

> [ENOMEM] Locking all of the pages currently mapped into the address space of the process would exceed an implementation-defined limit on the amount of memory that the process may lock.

[http://pubs.opengroup.org/onlinepubs/009695399/functions/mlockall.html](http://pubs.opengroup.org/onlinepubs/009695399/functions/mlockall.html)

---

<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, 11:35pm UTC](https://discuss.elastic.co/t/unable-to-lock-jvm-memory-enomem/35749/3 "2017-07-05T23:35:19Z")

</div>


