JNA not found native methods mlockall will be disabled – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 1.3-1.3

Briefly, this error occurs when Elasticsearch cannot find the Java Native Access (JNA) library, which is used to lock the memory and prevent it from swapping to disk. This can lead to performance issues. To resolve this, you can ensure that the JNA library is correctly installed and accessible by Elasticsearch. Alternatively, you can disable memory swapping on the operating system level. Also, check the Elasticsearch configuration file and ensure that bootstrap.memory_lock is set to true.

This guide will help you check for common problems that cause the log ” JNA not found. native methods (mlockall) will be disabled. ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “JNA not found. native methods (mlockall) will be disabled.” classname is CLibrary.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 
    static {
        try {
            Native.register("c");
        } catch (NoClassDefFoundError e) {
            logger.warn("JNA not found. native methods (mlockall) will be disabled.");
        } catch (UnsatisfiedLinkError e) {
            logger.warn("unable to link C library. native methods (mlockall) will be disabled.");
        }
    }





 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?