Score:1

Linux: 100 Mi RAM free but no processes with high-memory usage

se flag
Mat

A Debian Bullseye server is using almost 100% RAM quantity (7.65G / 7.79 G):

enter image description here

But there are no processes with more than 0.0% memory usage

DEV root@postgres2 ~# free -h
              total        used        free      shared  buff/cache   available
Mem:          7.8Gi       7.7Gi       100Mi       0.0Ki        42Mi        39Mi
Swap:          14Gi       767Mi        14Gi

DEV root@postgres2 ~# ps -eo pid,ppid,cmd,comm,%mem,%cpu --sort=-%mem | head -10
  PID  PPID CMD                         COMMAND         %MEM %CPU
 7072     1 /usr/bin/apt-get -o Debug:: apt-get          0.0 11.9
 8424     1 /usr/bin/apt-get -o Debug:: apt-get          0.0  7.8
 7252     1 /usr/bin/apt-get -o Debug:: apt-get          0.0 11.0
 8265     1 /usr/bin/apt-get -o Debug:: apt-get          0.0  8.3
 8085     1 /usr/bin/apt-get -o Debug:: apt-get          0.0  8.6
 9806 22518 postgres: 12/main: repmgr r postgres         0.0 13.0
 9703     1 /usr/bin/apt-get -o Debug:: apt-get          0.0  5.2
  206     1 /lib/systemd/systemd-journa systemd-journal  0.0  0.0
 9814  5382 ps -eo pid,ppid,cmd,comm,%m ps               0.0  0.0

I don't have so many processes running:

DEV root@postgres2 ~# ps ax|wc -l
224

Full memory usage:

DEV root@postgres2 ~# cat /proc/meminfo
MemTotal:        8170216 kB
MemFree:          131976 kB
MemAvailable:      42600 kB
Buffers:            7000 kB
Cached:            55200 kB
SwapCached:        52900 kB
Active:            82772 kB
Inactive:          73988 kB
Active(anon):      48652 kB
Inactive(anon):    49300 kB
Active(file):      34120 kB
Inactive(file):    24688 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:      15622140 kB
SwapFree:       15211964 kB
Dirty:                68 kB
Writeback:             0 kB
AnonPages:         92920 kB
Mapped:            33280 kB
Shmem:              3340 kB
Slab:            7808800 kB
SReclaimable:      36480 kB
SUnreclaim:      7772320 kB
KernelStack:        3616 kB
PageTables:        14860 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    19707248 kB
Committed_AS:    1162964 kB
VmallocTotal:   34359738367 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
Percpu:             1288 kB
HardwareCorrupted:     0 kB
AnonHugePages:      6144 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:               0 kB
DirectMap4k:     5609320 kB
DirectMap2M:     2779136 kB
DEV root@postgres2 ~# ps aux --sort -rss | head -n15
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root       381  0.0  0.8 1694928 68916 ?       Ssl   2022  44:28 /usr/share/auditbeat/bin/auditbeat --environment systemd -c /etc/auditbeat/auditbeat.yml --path.home /usr/share/auditbeat --path.config /etc/auditbeat --path.data /var/lib/auditbeat --path.logs /var/log/auditbeat
root       380  0.0  0.1 1373392 12796 ?       Ssl   2022   9:33 /usr/share/metricbeat/bin/metricbeat --environment systemd -c /etc/metricbeat/metricbeat.yml --path.home /usr/share/metricbeat --path.config /etc/metricbeat --path.data /var/lib/metricbeat --path.logs /var/log/metricbeat
nagios    1257  0.0  0.0 1056796 6756 ?        Sl    2022  22:49 /usr/lib/x86_64-linux-gnu/icinga2/sbin/icinga2 --no-stack-rlimit daemon --close-stdio -e /var/log/icinga2/error.log
root     23205  0.0  0.0 159992  5004 pts/0    S    16:00   0:00 fish
root     23273  0.0  0.0  10960  3348 pts/0    R+   16:00   0:00 ps aux --sort -rss
root       211  0.0  0.0  81564  2600 ?        Ss    2022  16:31 /lib/systemd/systemd-journald
root         1  0.0  0.0 170780  2596 ?        Ss    2022   3:11 /sbin/init
nagios    1262  0.0  0.0 259476  2268 ?        S     2022   6:05 /usr/lib/x86_64-linux-gnu/icinga2/sbin/icinga2 --no-stack-rlimit daemon --close-stdio -e /var/log/icinga2/error.log
me   23170  0.0  0.0 159752  1828 pts/0    Ss   16:00   0:00 -fish
me   23153  0.0  0.0  21164  1744 ?        Ss   16:00   0:00 /lib/systemd/systemd --user
postgres 23984  0.0  0.0 219008  1572 ?        Ss    2022  15:22 /usr/lib/postgresql/12/bin/postgres -D /var/lib/postgresql/12/main -c config_file=/etc/postgresql/12/main/postgresql.conf
root     23141  0.0  0.0  16616  1528 ?        Ss   16:00   0:00 sshd: me**strong text** [priv]
Debian-+   382  0.0  0.0  42988  1428 ?        Ss    2022  11:50 /usr/sbin/snmpd -Lsd -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux mteTrigger mteTriggerConf -f -p /run/snmpd.pid
postgres 21836  0.0  0.0 220064  1312 ?        Ss   15:51   0:00 postgres: 12/main: mydb mydb 192.168.100.33(52436) idle

How I can deal to understand whats going on?

jm flag
What does the command `pmap 9806 | grep total` show you. This is the amount of mapped memory for the postgres process.
John Mahowald avatar
cn flag
Please edit your question to add the output of `cat /proc/meminfo` under similar memory pressure. Summing RSS of processes will never result in exactly total memory use for various complicated reasons, especially if you ignore kernel memory and other things not accounted to a task.
asktyagi avatar
in flag
Add output of `ps aux --sort -rss | head -n15` to question please.
Mat avatar
se flag
Mat
I added output of `cat /proc/meminfo` and `ps aux --sort -rss | head -n15`
cn flag
Can you post the output of `sudo slabtop --sort c -o | head -20`? This looks like a kernel object leak.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.