Elasticsearch fails with error "This can result in part of the JVM being swapped out. Increase RLIMIT_MEMLOCK (ulimit)". What to do?

Jun 04, 2015 · Updated: Jan 30, 2021 · by Tim Kamanin

Well, basically, that means you have too low memlock limit setting in your OS. This can be easily fixed in two steps:

1) Edit /etc/security/limits.conf file and add to the end:

* hard memlock unlimited
* soft memlock unlimited

2) Add a line to the /etc/pam.d/common-session file:

session required pam_limits.so

that'll make sure your limits are loaded for every session.

3) Reboot the server.

4) Check your limits via:

ulimit -l

if all went well it should return


as an output.

P.S. As always, do all changes on your own risk and don't forget to backup before experimenting.

Hey, if you've found this useful, please share the post to help other folks find it:

There's even more:

Subscribe for updates

  • via Twitter: @timonweb
  • old school RSS:
  • or evergreen email ↓ ↓ ↓