I am running 22.04, and with the recent systemd-oomd issues 12 I am trying to figure out where my RAM is going. I have 16GB of RAM which should be plenty, but i'm constantly getting Chrome, Gnome Shell, Gnome Terminal's killed by oomd.
My process table (ps -ef
) doesn't correspond to my Memory usage from /proc/meminfo
, so I am trying to find other allocations of memory i'm not aware of to figure out where my RAM is being used. I am aware of ipcs, slabtop, but the memory allocations do not add up.
Based on my reading of the ps
output (below) I'm only using 8.4gb of RAM, but when looking at meminfo
I'm using 15+gb.
ps uax | awk '{ print $6 }' | sort -n | awk '{s+=$1} END {print s}' |
4551528
|
slabtop -s c -o | tail -n +7 | awk '{s =s+$7} END {print s}' |
1593640
|
ipcs |
------ Message Queues -------- key msqid owner perms used-bytes messages
------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x511c029a 196610 ruckc 600 16 1 0xca270022 196611 ruckc 600 65536 1 0x00000000 196632 ruckc 600 524288 2 dest
------ Semaphore Arrays -------- key semid owner perms nsems 0x00105b6b 2 root 600 1 0x00105b6c 3 root 666 2 0xcc270022 8 ruckc 600 1 0xcb270022 9 ruckc 600 1
|
cat /proc/meminfo |
MemTotal: 16088108 kB MemFree: 4183228 kB MemAvailable: 5130228 kB Buffers: 1084 kB Cached: 2270828 kB SwapCached: 22000 kB Active: 620544 kB Inactive: 2647548 kB Active(anon): 138556 kB Inactive(anon): 1932644 kB Active(file): 481988 kB Inactive(file): 714904 kB Unevictable: 900756 kB Mlocked: 72936 kB SwapTotal: 2097148 kB SwapFree: 1967088 kB Dirty: 2856 kB Writeback: 0 kB AnonPages: 1875816 kB Mapped: 562296 kB Shmem: 1072444 kB KReclaimable: 135272 kB Slab: 1624092 kB SReclaimable: 135272 kB SUnreclaim: 1488820 kB KernelStack: 18176 kB PageTables: 35684 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 10141200 kB Committed_AS: 9789584 kB VmallocTotal: 34359738367 kB VmallocUsed: 591532 kB VmallocChunk: 0 kB Percpu: 10848 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: 3318960 kB DirectMap2M: 13158400 kB DirectMap1G: 1048576 kB
|
free -h |
total used free shared buff/cache available Mem: 15Gi 9.1Gi 4.0Gi 1.0Gi 2.3Gi 4.9Gi Swap: 2.0Gi 127Mi 1.9Gi
|
oomd log: journalctl -xeu systemd-oomd.service | grep Killed
Apr 13 10:51:39 laptop systemd-oomd[3562]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-google\x2dchrome-11396.scope due to memory used (16109408256) / total (16474247168) and swap used (1982627840) / total (2147479552) being more than 90.00%
Apr 13 13:09:57 laptop systemd-oomd[3363]: Killed /user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.Shell@wayland.service due to memory used (16195358720) / total (16474247168) and swap used (2053111808) / total (2147479552) being more than 90.00%
Apr 14 13:21:21 laptop systemd-oomd[3248]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-google\x2dchrome-41482.scope due to memory used (16056369152) / total (16474247168) and swap used (1945407488) / total (2147479552) being more than 90.00%
Apr 18 09:58:14 laptop systemd-oomd[3457]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-org.gnome.Nautilus-0.scope due to memory used (16223395840) / total (16474243072) and swap used (2027683840) / total (2147479552) being more than 90.00%
Apr 18 09:58:15 laptop systemd-oomd[3457]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-org.gnome.Nautilus-0.scope due to memory used (16091160576) / total (16474243072) and swap used (2145886208) / total (2147479552) being more than 90.00%
Apr 18 09:58:15 laptop systemd-oomd[3457]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-org.gnome.Nautilus-0.scope due to memory used (16159051776) / total (16474243072) and swap used (2073485312) / total (2147479552) being more than 90.00%
Apr 18 09:58:15 laptop systemd-oomd[3457]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-org.gnome.Nautilus-0.scope due to memory used (16212561920) / total (16474243072) and swap used (2008236032) / total (2147479552) being more than 90.00%
Apr 18 09:58:15 laptop systemd-oomd[3457]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-org.gnome.Nautilus-0.scope due to memory used (15865094144) / total (16474243072) and swap used (1974681600) / total (2147479552) being more than 90.00%
Apr 20 16:00:06 laptop systemd-oomd[3457]: Killed /user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.Shell@wayland.service due to memory used (16120066048) / total (16474243072) and swap used (1999306752) / total (2147479552) being more than 90.00%
Apr 20 16:04:18 laptop systemd-oomd[3457]: Killed /user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.Shell@wayland.service due to memory used (16117116928) / total (16474243072) and swap used (2039713792) / total (2147479552) being more than 90.00%
Apr 26 08:07:19 laptop systemd-oomd[3457]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-code-2704032.scope due to memory used (16189804544) / total (16474243072) and swap used (1975377920) / total (2147479552) being more than 90.00%
May 03 12:17:16 laptop systemd-oomd[3253]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-jetbrains\x2dtoolbox-10574.scope due to memory used (15012593664) / total (16474185728) and swap used (1944969216) / total (2147479552) being more than 90.00%
May 04 22:31:52 laptop systemd-oomd[3253]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-google\x2dchrome-1560985.scope due to memory used (15096467456) / total (16474185728) and swap used (2009534464) / total (2147479552) being more than 90.00%
May 05 12:34:52 laptop systemd-oomd[3354]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-google\x2dchrome-47763.scope due to memory used (16104947712) / total (16474189824) and swap used (1948254208) / total (2147479552) being more than 90.00%
May 09 10:26:05 laptop systemd-oomd[847696]: Killed /user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.Shell@wayland.service due to memory used (16139558912) / total (16474193920) and swap used (2147348480) / total (2147479552) being more than 90.00%
May 10 19:40:25 laptop systemd-oomd[847696]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-google\x2dchrome-950608.scope due to memory used (16102866944) / total (16474193920) and swap used (2071912448) / total (2147479552) being more than 90.00%
May 10 19:49:30 laptop systemd-oomd[847696]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-org.gnome.Terminal.slice/vte-spawn-16c14424-f9a9-4c04-8ff2-0755377a7539.scope due to memory used (16022802432) / total (16474193920) and swap used (1948741632) / total (2147479552) being more than 90.00%
May 11 09:00:04 laptop systemd-oomd[847696]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-org.gnome.Terminal.slice/vte-spawn-71b574b8-17e5-408b-b91f-431a458d55bb.scope due to memory used (15930691584) / total (16474193920) and swap used (2041720832) / total (2147479552) being more than 90.00%
May 11 10:20:57 laptop systemd-oomd[847696]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-google\x2dchrome-2201754.scope due to memory used (15575441408) / total (16474193920) and swap used (1939279872) / total (2147479552) being more than 90.00%
May 11 12:05:21 laptop systemd-oomd[847696]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-org.gnome.Terminal.slice/vte-spawn-24f78600-4612-4805-9b29-a96ca4f432cb.scope due to memory used (15433670656) / total (16474193920) and swap used (1950101504) / total (2147479552) being more than 90.00%
May 11 12:05:51 laptop systemd-oomd[847696]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-google\x2dchrome-2814868.scope due to memory used (15329484800) / total (16474193920) and swap used (1946755072) / total (2147479552) being more than 90.00%
May 11 12:06:29 laptop systemd-oomd[847696]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-netbeans-2803190.scope due to memory used (15826632704) / total (16474193920) and swap used (2145792000) / total (2147479552) being more than 90.00%
May 11 14:33:29 laptop systemd-oomd[847696]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-google\x2dchrome-2909372.scope due to memory used (15613919232) / total (16474193920) and swap used (1933402112) / total (2147479552) being more than 90.00%
May 11 14:56:16 laptop systemd-oomd[847696]: Killed /user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.Shell@wayland.service due to memory used (16104726528) / total (16474193920) and swap used (1968328704) / total (2147479552) being more than 90.00%
May 12 08:25:14 laptop systemd-oomd[847696]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-jetbrains\x2dpycharm-3483077.scope due to memory used (15616532480) / total (16474193920) and swap used (1937936384) / total (2147479552) being more than 90.00%
May 12 11:15:23 laptop systemd-oomd[847696]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-google\x2dchrome-3361444.scope due to memory used (15812100096) / total (16474193920) and swap used (1955221504) / total (2147479552) being more than 90.00%
May 12 17:58:07 laptop systemd-oomd[847696]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-google\x2dchrome-722172.scope due to memory used (16039403520) / total (16474193920) and swap used (1988845568) / total (2147479552) being more than 90.00%
May 13 11:30:57 laptop systemd-oomd[847696]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-google\x2dchrome-1218538.scope due to memory used (16068583424) / total (16474193920) and swap used (2087342080) / total (2147479552) being more than 90.00%
May 13 11:30:59 laptop systemd-oomd[847696]: Killed /user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.Shell@wayland.service due to memory used (16112533504) / total (16474193920) and swap used (1946112000) / total (2147479552) being more than 90.00%
May 18 15:47:46 laptop systemd-oomd[847696]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-org.gnome.Terminal.slice/vte-spawn-921c3683-819b-4f55-ba40-5bcd85681825.scope due to memory used (16058290176) / total (16474193920) and swap used (2002198528) / total (2147479552) being more than 90.00%
May 20 09:03:27 laptop systemd-oomd[847696]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-google\x2dchrome-1534842.scope due to memory used (15276462080) / total (16474193920) and swap used (1937162240) / total (2147479552) being more than 90.00%
Jun 03 12:15:36 laptop systemd-oomd[3298]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-jetbrains\x2dwebstorm-541749.scope due to memory used (15719739392) / total (16474193920) and swap used (1967783936) / total (2147479552) being more than 90.00%
Jun 08 00:21:43 laptop systemd-oomd[3768]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-google\x2dchrome-16072.scope due to memory used (15445958656) / total (16474218496) and swap used (1942192128) / total (2147479552) being more than 90.00%
Jun 08 07:14:28 laptop systemd-oomd[3768]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-teams-2369963.scope due to memory used (15633932288) / total (16474218496) and swap used (1964466176) / total (2147479552) being more than 90.00%
Jun 08 07:16:38 laptop systemd-oomd[3768]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-jetbrains\x2dgoland-2978322.scope due to memory used (15238217728) / total (16474218496) and swap used (1939480576) / total (2147479552) being more than 90.00%
Jun 13 10:14:46 laptop systemd-oomd[7467]: Killed /user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.Shell@wayland.service due to memory used (15284772864) / total (16474218496) and swap used (1937956864) / total (2147479552) being more than 90.00%
free -h
output is that even if you have 4.91GB available the system is using Swap. This makes me think that swap exchange may occur and be the cause of the crash if there high demand for exchange. I'll update my answer to suggest using a swappiness of 10, I believe you have the default value of 60. – Carles Mateo Jun 23 '22 at 06:58