# Problem configuring the memory

**URL:** <https://discuss.elastic.co/t/problem-configuring-the-memory/48674>\
**Category:** Elasticsearch\
**Created:** [April 28, 2016, 12:52pm UTC](https://discuss.elastic.co/t/problem-configuring-the-memory/48674 "2016-04-28T12:52:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![NekoNova](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nekonova/32/7359_2.png) [@NekoNova](https://discuss.elastic.co/u/NekoNova)\
**Post date:** [April 28, 2016, 12:52pm UTC](https://discuss.elastic.co/t/problem-configuring-the-memory/48674/1 "2016-04-28T12:52:16Z")

</div>

Hello,

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.

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [May 3, 2016, 12:39pm UTC](https://discuss.elastic.co/t/problem-configuring-the-memory/48674/2 "2016-05-03T12:39:52Z")

</div>

Hi Arne,

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

```auto
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: [https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html#setup-configuration-memory](https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html#setup-configuration-memory)).

Daniel

---

<div class="post-metadata">

**Author:** ![NekoNova](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nekonova/32/7359_2.png) [@NekoNova](https://discuss.elastic.co/u/NekoNova)\
**Post date:** [May 3, 2016, 12:55pm UTC](https://discuss.elastic.co/t/problem-configuring-the-memory/48674/3 "2016-05-03T12:55:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [May 3, 2016, 1:22pm UTC](https://discuss.elastic.co/t/problem-configuring-the-memory/48674/4 "2016-05-03T13:22:43Z")

</div>

Hi Arne,

great to hear that it works now.

Daniel

---

<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:54pm UTC](https://discuss.elastic.co/t/problem-configuring-the-memory/48674/5 "2017-07-05T22:54:23Z")

</div>


