0

I ran some commands (in a script to be fast) and got this:

$ ps -A | wc -l
513

$ echo "$((ps -A -o rss |tr "\n" +0))" 4368208

$ free total used free shared buff/cache available Mem: 5993608 5157844 132848 42616 702916 519028 Swap: 21030892 5276136 15754756

$ cat /proc/meminfo MemTotal: 5993608 kB MemFree: 132996 kB MemAvailable: 519176 kB Buffers: 83384 kB Cached: 514368 kB SwapCached: 422808 kB Active: 392060 kB Inactive: 1572336 kB Active(anon): 106632 kB Inactive(anon): 1312656 kB Active(file): 285428 kB Inactive(file): 259680 kB Unevictable: 27084 kB Mlocked: 27084 kB SwapTotal: 21030892 kB SwapFree: 15754756 kB Dirty: 264 kB Writeback: 0 kB AnonPages: 1190852 kB Mapped: 1107036 kB Shmem: 42616 kB KReclaimable: 105164 kB Slab: 291468 kB SReclaimable: 105164 kB SUnreclaim: 186304 kB KernelStack: 19376 kB PageTables: 58636 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 24027696 kB Committed_AS: 14543756 kB VmallocTotal: 34359738367 kB VmallocUsed: 117308 kB VmallocChunk: 0 kB Percpu: 7072 kB HardwareCorrupted: 0 kB AnonHugePages: 0 kB ShmemHugePages: 0 kB ShmemPmdMapped: 0 kB FileHugePages: 0 kB FilePmdMapped: 0 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB Hugetlb: 0 kB DirectMap4k: 5936768 kB DirectMap2M: 335872 kB DirectMap1G: 0 kB

where did 789636 kB (5157844-4368208) go?
My final goal is to determine what is using that RAM and if it can be freed.
I need to be able to list what is using that RAM if possible.
Is there a better ps command parameters for that?

related:
RAM usage doesn't add up? (Free+used < total)
Substantial portion of memory used is not accounted for by user processes

1 Answers1

2

The kernel itself uses some ram, but most of it is in that 702,916k of buffers/cache.

psusi
  • 17,303