3
$ free
              total        used        free      shared  buff/cache   available
Mem:       16349804     4727520     9075260       13992     2547024    11238920
Swap:      19528700       12284    19516416

$ cat /proc/vmstat
nr_free_pages 2268791
nr_file_pages 502861

$ cat /proc/meminfo
MemTotal:       16349804 kB
MemFree:         9075360 kB
MemAvailable:   11239020 kB
Buffers:         1063716 kB
Cached:           939312 kB
SwapCached:         8416 kB

Why the buff/cache(2547024) showed in free command is more than which listed in vmstat(502861*4=2011444) or meminfo(1063716+939312+8416=2011444)?

$ uname -a
Linux OP3020 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ free --version
free from procps-ng 3.3.10
Bbs Faqs
  • 31
  • 1
  • 2
  • 2
    Possible duplicate of [Meaning of the buffers/cache line in the output of free](http://serverfault.com/questions/85470/meaning-of-the-buffers-cache-line-in-the-output-of-free) – Dennis Nolte Feb 13 '17 at 08:18

1 Answers1

1

"buffer and cache" field displayed in free command was changed after version procps-ng 3.3.10.

Prior to 3.3.10, free command displays buffers and cache separately as below

$ free
             total       used       free     shared    buffers     cached
Mem:      16333720   15321808    1011912          0      48860    3062900
-/+ buffers/cache:   12210048    4123672
Swap:      5242872     518732    4724140

But after that free command display a field buff/cache it is the sum of Buffers, Cached and Slab in /proc/meminfo file.

$ free
              total        used        free      shared  buff/cache   available
Mem:       32780676     2597432     4668032     1474028    25515212    28146744
Swap:       8388604       58692     8329912

/proc/meminfo
Buffers:            3140 kB
Cached:         24345064 kB
SwapCached:           64 kB
Slab:            1167008 kB

Here sum of Buffers(3140), Cached(24345064) and Slab(1167008) equals to the "buff/cache" field in "free" command output. For more info refer here which is for RHEL but gives answer to your question.

RalfFriedl
  • 3,008
  • 4
  • 12
  • 17