OS reported a negative free swap space size – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7.7-7.8

Briefly, this error occurs when the operating system reports a negative value for the available swap space. This could be due to a bug in the operating system or Elasticsearch misinterpreting the OS data. To resolve this issue, you can try updating your Elasticsearch to the latest version or check your operating system for any updates or patches. Alternatively, you can disable swap space checking in Elasticsearch by setting “bootstrap.memory_lock” to true in the Elasticsearch configuration file.

This guide will help you check for common problems that cause the log ” OS reported a negative 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 “OS reported a negative free swap space size [{}]” classname is OsProbe.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

            return 0;
        try {
            final long mem = (long) getFreeSwapSpaceSize.invoke(osMxBean);
            if (mem 


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?