Mlockall: what happens if no memory available?

Hi all,

to prevent os from swapping, it's recommended to set bootstrap.mlockall: true.

I wonder the following. What happens in situations when no memory is available anymore? Does the jvm chrash in such a case? And if so, whats the benefit in using mlockall compared to swapping?

Regards,

Abid

The mlockall option only locks the ES JVM into RAM. The rest of the OS might still swap. If Linux completely runs out of memory it will start killing processes more or less randomly.

Ok, thanks.

So setting mlockall to true just means that the jvm memory won't be swapped, it has no effect on what happens when jvm runs out or memory as it will still crash in that case. Please correct me if I'm wrong.

Regards,

Abid

If the application running in the JVM runs out of heap it'll obviously crash with OutOfMemoryError, but that has nothing to do with mlockall. The JVM process itself can't run out of memory once it has been locked into RAM.

Thanks for clarification.