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; } } /**