Problem configuring the memory


I've installed Elasticsearch on the new Ubuntu 16, using the apt-get packages, and the service seems to be running fine. When I curl the localhost, I can see the response, so the basic configuration is working at least.

However, when I take a look at the logs, I keep getting this:

[2016-04-28 14:44:43,641][WARN ][bootstrap ] Unable to lock JVM Memory: error=12,reason=Cannot allocate memory [2016-04-28 14:44:43,641][WARN ][bootstrap ] This can result in part of the JVM being swapped out. [2016-04-28 14:44:43,641][WARN ][bootstrap ] Increase RLIMIT_MEMLOCK, soft limit: 65536, hard limit: 65536 [2016-04-28 14:44:43,641][WARN ][bootstrap ] These can be adjusted by modifying /etc/security/limits.conf, for example: # allow user 'elasticsearch' mlockall elasticsearch soft memlock unlimited elasticsearch hard memlock unlimited

I've been going through the documentation, and took the required steps of setting the configuration where needed, but I'm a bit at a loss now on what to do. I've logged out and in again to make sure the settings are applied, but the error keeps popping up.

Could someone give me a hand on what to check and change?
I'm not an expert when it comes to linux, and would like to resolve this problem.

Our VM runs with 16GB of RAM, and we've set the heap size variable to 8GB as recommended by the documentation.

1 Like

Hi Arne,

I assume you also have added the following lines in /etc/security/limits.confas suggested by the warning:

elasticsearch soft memlock unlimited
elasticsearch hard memlock unlimited

The reference documentation suggests also another reason: your temporary directory could be mounted with noexec (see section "mlockall" at:


Checked yes and I added those lines when we setup the box.
Rebooting the box fixed it apparently

Hi Arne,

great to hear that it works now.