I have a machine that leaks memory (even after an application restart) - two machines run similar applications with similar workloads, slightly different kernel revisions of 4.x
The noticeable difference is that the total (from /proc/meminfo) of
shmem compared to
Buffer is different for the bad machine and the same for the good (and other) machines.
Should these values be the same? Does this look like a kernel bug/leak?
/proc/meminfo (converted to MB)
Bad m Good m 48042 48042 mB MemTotal: 376 495 mB MemFree: 25904 26086 mB MemAvailable: 0 0 mB Buffers: 3589 11034 mB Cached: 29 69 mB SwapCached: 31825 24374 mB Active: 14010 5505 mB Inactive: 19263 19191 mB Active(anon): 1889 2090 mB Inactive(anon): 12561 5183 mB Active(file): 12121 3414 mB Inactive(file): 655 2436 mB Shmem:
4877 28240 mB Cache+Slab Mem:buffer/cache 42788 19307 mB MemTotal-MemFree-Cached-Slab Mem:used 25338 11034 mB Active(file)+Inactive(file)+shmem 3589 11034 mB Cached -21750 0 mB diff
Further investigation finds that if something like this script is run (on the bad kernel only), it will cause the discrepancy to increase until free is around zero, then remains at equilibrium:
#!/bin/ksh while true do X=`/bin/echo 1` done