0

I'm working on a debian 9.3, the free command return

              total        used        free      shared  buff/cache   available
Mem:      131940516   100433176    29189576       33940     2317764    30413920
Swap:     124999676        7736   124991940

so ≃ 22% of free memory, but the 4th column of ps aux --sort -rss sum up to 20.9 (% of used memory)

cat /proc/meminfo | sort -k2,2nr return that

VmallocTotal:   34359738367 kB
CommitLimit:    190969932 kB
MemTotal:       131940516 kB
SwapTotal:      124999676 kB
SwapFree:       124991940 kB
DirectMap2M:    94552064 kB
DirectMap1G:    40894464 kB
Committed_AS:   31307212 kB
MemAvailable:   30854080 kB
MemFree:        29629760 kB
Active:         28760588 kB
AnonPages:      28192300 kB
Active(anon):   27489640 kB
Slab:            3245360 kB
SUnreclaim:      2746444 kB
Cached:          1735180 kB
Active(file):    1270948 kB
Inactive:        1252084 kB
DirectMap4k:      788164 kB
Inactive(anon):   738148 kB
Inactive(file):   513936 kB
SReclaimable:     498916 kB
Buffers:           83652 kB
PageTables:        62240 kB
Mapped:            47016 kB
Shmem:             33940 kB
KernelStack:       32352 kB
Hugepagesize:       2048 kB
SwapCached:         2004 kB
Dirty:                36 kB
AnonHugePages:         0 kB
Bounce:                0 kB
HardwareCorrupted:     0 kB
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
HugePages_Total:       0
Mlocked:               0 kB
NFS_Unstable:          0 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
Unevictable:           0 kB
VmallocChunk:          0 kB
VmallocUsed:           0 kB
Writeback:             0 kB
WritebackTmp:          0 kB

What process is consuming my memory?

1 Answer 1

1
MemAvailable:   30854080 kB

Not quite 29 GB is available memory without swapping. If you change nothing, this workload will not be under memory pressure. Actually, because most of this is MemFree, it is "wasted", not even used for file caches.

Although it is a good indicator of the working set in memory, summing RSS will be inaccurate. RSS is recent pages, whether or not they are shared. Linux is only going to have one copy of shared pages.

Actually getting memory use per process with a fair treatment of shared pages is annoying. smem is one tool that attempts to do so by parsing every memory mapping in /proc/$pid/smaps

1
  • Thanks Johan, smem report a lot of "kernel dynamic memory". I'm trying to understand what that means, if it is a concern, and why it appen.
    – mox
    Feb 9, 2018 at 16:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .