I’m completely stumped. I though I had a decent understanding on how to track memory usage on Linux, but this is beyond me.
When I start me laptop (Ryzen 7 3750H + RX5500M), typical memory usage is about 1 GB. If I keep it on for couple of days, it’ll gradually increase until it takes up most of my memory and than start eating swap as well. Which would be fine, if I could actually see what it is.
I started with
htop, couldn’t find anything using more that 500 MB and decided to just kill everything until it frees up. I’ve killed almost everything I could and according to
smem, was barely using any memory:
PID User Command Swap USS PSS RSS 1171 user (sd-pam) 2.6M 100.0K 289.0K 900.0K 418 systemd-timesync /usr/lib/systemd/systemd-ti 776.0K 208.0K 387.0K 1.6M 300 root /usr/lib/systemd/systemd-ud 2.7M 708.0K 961.0K 2.4M 426 root /usr/lib/systemd/systemd-lo 496.0K 1.3M 1.8M 4.2M 1170 user /usr/lib/systemd/systemd -- 944.0K 1.5M 2.3M 4.5M 757 root /usr/lib/accounts-daemon 332.0K 2.7M 2.8M 3.7M 781 root /usr/bin/wpa_supplicant -u 572.0K 2.9M 3.0M 3.8M 178720 root login -- user 0 1.6M 3.0M 6.0M 423 dbus /usr/bin/dbus-daemon --syst 544.0K 2.9M 3.1M 4.0M 1 root /sbin/init 688.0K 2.2M 3.3M 6.0M 217826 root -zsh 0 2.3M 3.5M 6.4M 217825 root sudo -i 0 2.7M 4.5M 8.1M 217401 user -zsh 0 3.2M 4.5M 7.5M 194443 user /usr/bin/pulseaudio --daemo 2.2M 5.8M 6.5M 8.7M 217852 root python /usr/bin/smem -k 0 12.8M 13.2M 15.2M 277 root /usr/lib/systemd/systemd-jo 836.0K 20.7M 28.0M 36.6M
free is telling a different story:
total used free shared buff/cache available Mem: 13Gi 7.0Gi 5.3Gi 97Mi 1.3Gi 6.2Gi Swap: 8.0Gi 3.2Gi 4.8Gi
After a reboot it all goes away. After couple of incidents like this it occurred to me to check tmpfs as files in there could contribute to the consumption. I’ve checked all of the tmpfs mountpoints, but they total to about 500 MB.
There are no zombie or defunct processes in
ps or anything that would indicate a memory leak.
I don’t have any docker containers or virtual machines.
The only vague link I have is that it might be somehow linked to my Steam Proton usage. I think when I’m using Proton heavily in the day, it snow-piles faster, but I couldn’t confirm that by starting and closing stuff with it.
Do you guys have any thoughts on what could it be? I’m not even worried about rebooting as much as I’m curious how is that even possible.
TL;DR: Something’s eating my RAM, doesn’t show up in
smem. Where could it be?