# Problem to set up max locked memory on CentOS 7

**URL:** <https://discuss.elastic.co/t/problem-to-set-up-max-locked-memory-on-centos-7/20199>\
**Category:** Elasticsearch\
**Created:** [October 11, 2014, 11:16am UTC](https://discuss.elastic.co/t/problem-to-set-up-max-locked-memory-on-centos-7/20199 "2014-10-11T11:16:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![revolucio](https://avatars.discourse-cdn.com/v4/letter/r/b77776/32.png) [@revolucio](https://discuss.elastic.co/u/revolucio)\
**Post date:** [October 11, 2014, 11:16am UTC](https://discuss.elastic.co/t/problem-to-set-up-max-locked-memory-on-centos-7/20199/1 "2014-10-11T11:16:05Z")

</div>

Hi,

I'm trying to setup the max locked memory to unlimited on Centos 7 but all what I did doesn't work.

This is my current setup:

On _/etc/security/limits.conf_

I add

_elasticsearch soft memlock unlimited  
elasticsearch hard memlock unlimited_

On my /etc/passwd I assing a bash shell to my elasticsearch user and I did a  
_sudo elasticsearch  
ulimit -l  
unlimited_

So it seem the user see the change.

Then I restart elasticsearch ( first I did a logout/login to be sure also from root user the change is present ) ,and with the _cat /proc/elasticsearch\_PID/limits_ I have

_Max locked memory 65536 65536 bytes_

Also I try to but on my root .bashrc

_export ES\_HEAP\_SIZE=4g  
export MAX\_LOCKED\_MEMORY=unlimited_

And the last try was to put it on /etc/elasticsearch/elasticsearch.yml  
ES\_HEAP\_SIZE: 4g  
MAX\_LOCKED\_MEMORY: unlimited

And always the same result after restart the service.

Any idea will be more than welcome.

Best

---

<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, 12:56am UTC](https://discuss.elastic.co/t/problem-to-set-up-max-locked-memory-on-centos-7/20199/2 "2017-07-06T00:56:48Z")

</div>


