0

I noticed that meminfo - Buffers occupies significant amount of RAM on some servers in my work environment.

I'd like to know what is exactly is "Buffers" and why it takes that much amount of RAM. Some quick googling indicate that "Buffers" are Cached equivalent of non-file-data, however it's difficult to explain why "Buffers" takes 10G RAM - while Cached takes less than 7X of that.

This example data is a build server. Several people use it to build some large projects, e.g. Android. There is no (non-trivial) service running on it. It's not heavily used. When taking /proc/meminfo data, it is idle.

lsb_release -a

LSB Version:    core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch  
Distributor ID: Ubuntu  
Description:    Ubuntu 11.04  
Release:    11.04  
Codename:   natty  

cat /proc/meminfo

MemTotal:       99166244 kB  
MemFree:          468604 kB  
Buffers:        10315020 kB  
Cached:         68312620 kB  
SwapCached:        41364 kB  
Active:         42604444 kB  
Inactive:       40784816 kB  
Active(anon):    4424120 kB  
Inactive(anon):   421392 kB  
Active(file):   38180324 kB  
Inactive(file): 40363424 kB  
Unevictable:           0 kB  
Mlocked:               0 kB  
SwapTotal:       2008120 kB  
SwapFree:        1120892 kB  
Dirty:              4872 kB  
Writeback:             0 kB  
AnonPages:       4733328 kB  
Mapped:           116032 kB  
Shmem:             83812 kB  
Slab:           13248832 kB  
SReclaimable:   13047840 kB  
SUnreclaim:       200992 kB  
KernelStack:       14064 kB  
PageTables:       147124 kB  
NFS_Unstable:          0 kB  
Bounce:                0 kB  
WritebackTmp:          0 kB  
CommitLimit:    51591240 kB  
Committed_AS:   16135556 kB  
VmallocTotal:   34359738367 kB  
VmallocUsed:      535184 kB  
VmallocChunk:   34359200236 kB  
HardwareCorrupted:     0 kB  
HugePages_Total:       0  
HugePages_Free:        0  
HugePages_Rsvd:        0  
HugePages_Surp:        0  
Hugepagesize:       2048 kB  
DirectMap4k:      669696 kB  
DirectMap2M:    24479744 kB  
DirectMap1G:    75497472 kB  
  • http://www.redhat.com/advice/tips/meminfo.html – user9517 Apr 23 '14 at 06:44
  • http://tiebing.blogspot.co.uk/2009/10/understand-linux-procmeminfo.html – user9517 Apr 23 '14 at 06:51
  • I'm asking why Buffers takes 10% RAM. man proc indicates it's "small", and on client PC it usually **is**, less than 1-2% RAM. – user2771324 Apr 23 '14 at 06:52
  • Direct disk IO also uses buffers. For example `dd if=/dev/sda of=/dev/null bs=1M count=2048` will likely increase buffers by a ~ 2GB unless the first 2GB of /dev/sda is already in the buffers or there is some memory pressure. – Brian Apr 23 '14 at 07:47
  • @Brian thanks, I wasn't aware that Direct disk IO can fully become "buffers". However in my case, I suspect it's not the root cause. Because I read many GiB data, Buffers/Cached is roughly unchanged. (Does Buffers shrink if memory pressure come from more file data read?) – user2771324 Apr 23 '14 at 08:55

0 Answers0