Thursday, July 4, 2019

memory usage - Linux: drop caches do not free buffers/cache - why?

Since I've found discussion of buffers/cache on that site, not Unix of SE, I post my question here. I've read In Linux, what is the difference between "buffers" and "cache" reported by the free command? and Meaning of the buffers/cache line in the output of free, where it is written:




caches will be freed automatically if memory gets scarce, so they do
not really matter.




Currently free reports 8Gb of buffers/cache, however, system when approaching zero free memory becomes unresponsive for long time and sync; echo 3 > /proc/sys/vm/drop_caches does not change much. Why? I post output of free -m and also more detailed output of cat /proc/meminfo:




              total        used        free      shared  buff/cache   available
Mem: 15740 4508 2366 8453 8865 2474

MemTotal: 16118172 kB
MemFree: 528472 kB
MemAvailable: 475820 kB
Buffers: 1588 kB
Cached: 8939100 kB
SwapCached: 0 kB
Active: 6711540 kB

Inactive: 8440460 kB
Active(anon): 6621624 kB
Inactive(anon): 8402256 kB
Active(file): 89916 kB
Inactive(file): 38204 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB

Writeback: 0 kB
AnonPages: 6211412 kB
Mapped: 1534592 kB
Shmem: 8812568 kB
Slab: 203244 kB
SReclaimable: 106932 kB
SUnreclaim: 96312 kB
KernelStack: 18736 kB
PageTables: 93880 kB
NFS_Unstable: 0 kB

Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 8059084 kB
Committed_AS: 23933660 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
HardwareCorrupted: 0 kB
AnonHugePages: 0 kB
ShmemHugePages: 0 kB

ShmemPmdMapped: 0 kB
CmaTotal: 0 kB
CmaFree: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 1761344 kB
DirectMap2M: 14704640 kB

DirectMap1G: 1048576 kB

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...