7

I'm using CentOS 7, I find my available memory is less than free memory, but why?

root@localhost:~# free -h
              total        used        free      shared  buff/cache   available
Mem:           251G        1.9G        249G        9.2M        260M        248G
Swap:           64M         49M         14M

There is a same problem, but the answer did not explain why the available is less than free, it is just talk about the cache.

why centos7 free command output available value less than free value

Index
  • 83
  • 1
  • 1
  • 3

2 Answers2

3

The available memory is just a estimate of how memory can be really used in your system for loading programs, so it is not a precise value.

As you probably already knows the normal behavior is to have the available memory bigger than the free memory, but in your case the opposite occurs, because the statistics used to calculate this estimated value will be helped by greater cache/buffers values, but they are penalized in your system because you dont have high cache or buffers, and because all the other things it takes into negative account, your available memory will get greater negative impact... so it is probably underestimated, as it will consider that this percentage of all your free memory, will be necessary for a lot of other things than simple loading programs (specially when you load programs - system will need more and more memory to store informations about the processes and much more - also like having a reasonable value of caches and buffers......).

From github:

MemAvailable: An estimate of how much memory is available for starting new applications, without swapping. Calculated from MemFree, SReclaimable, the size of the file LRU lists, and the low watermarks in each zone. The estimate takes into account that the system needs some page cache to function well, and that not all reclaimable slab will be reclaimable, due to items being in use. The impact of those factors will vary from system to system. To get a more detailed answer, you will need to post the contents of your /proc/meminfo.

2

If you read the CentOS 7 man page on free, it explains that the available field takes into account that not all reclaimable memory will be reclaimed due to some items being in use (memory available to the kernel, for example), unlike the cache and free fields. I believe that this could be the cause of the differences you're seeing.

available: Estimation of how much memory is available for starting new applications, without swapping. Unlike the data provided by the cache or free fields, this field takes into account page cache and also that not all reclaimable memory slabs will be reclaimed due to items being in use (MemAvailable in /proc/meminfo, available on kernels 3.14, emulated on kernels 2.6.27+, otherwise the same as free)

L.Ray
  • 469