OS reported a negative total memory value – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7.1-7.8

Briefly, this error occurs when Elasticsearch’s JVM is unable to accurately determine the total memory of the operating system, resulting in a negative value. This could be due to a bug in the JVM or an issue with the OS. To resolve this, you can try updating your JVM to the latest version or check your OS for any issues. Alternatively, you can manually specify the heap size for Elasticsearch, ensuring it’s less than the total physical memory, to prevent it from auto-detecting the memory size.

This guide will help you check for common problems that cause the log ” OS reported a negative total memory value [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: monitor, memory.

Log Context

Log “OS reported a negative total memory value [{}]” classname is OsProbe.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

            return 0;
        }
        try {
            final long totalMem = (long) getTotalPhysicalMemorySize.invoke(osMxBean);
            if (totalMem 


 

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?