Exception retrieving free swap space size – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-8.9

Briefly, this error occurs when Elasticsearch is unable to retrieve the size of the free swap space in your system. This could be due to insufficient permissions or an unsupported operating system. To resolve this issue, you can either grant the necessary permissions to Elasticsearch or disable the usage of swap space by setting bootstrap.memory_lock to true in the Elasticsearch configuration file. Alternatively, you can also configure your operating system to provide swap space information in a way that Elasticsearch can understand.

This guide will help you check for common problems that cause the log ” exception retrieving free swap space size ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: monitor.

Log Context

Log “exception retrieving free swap space size” classname is OsProbe.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                logger.debug("OS reported a negative free swap space size [{}]"; mem);
                return 0;
            }
            return mem;
        } catch (Exception e) {
            logger.warn("exception retrieving free swap space size"; e);
            return 0;
        }
    }

    /**

 

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?