`gnome-shell` uses too much RAM and eventually causes my swap to fill up and my system to freeze with disk I/O
Affected version
- OS: Pop!_OS 20.04 / Gnome LTS
- Gnome: 3.36.2
- Xorg
Bug summary
gnome-shell
uses too much RAM and eventually causes my swap to fill up and my system to freeze with disk I/O
Steps to reproduce
- Run
htop
and sort by %MEM - Notice that your "Swap" and "Mem" usage grows over time
- Notice that
gnome-shell
rises to the top of the list and continues to use RAM - You can kill all of your other programs (Firefox, Tilix, Sublime Text 3, etc.) and you don't get any memory back
- You can kill
gnome-shell
and relieve the pressure on the system, but it will slowly grow over time
What happened
I've been using my system for over 2 years with 8GB RAM and everything was fine. Several months ago I noticed that my system would freeze sometimes and I was forced to reboot. I finally figured out that I was running out of RAM and swap so I upgraded to 16GB RAM, knowing that wouldn't solve the problem but it might give me a clue. I eventually figured out that gnome-shell
was using %50 of my MEM% in "htop" which didn't seem correct.
What did you expect to happen
I expected gnome-shell
to not continue to grow in memory usage, eventually reaching 7.4GB of RAM.
Relevant logs, screenshots, screencasts etc.
Related to #2870
I tried to run the valgrind
debuging process but it produced no errors and this message:
"ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)"
$ systemctl status 1226
● user@120.service - User Manager for UID 120
Loaded: loaded (/lib/systemd/system/user@.service; static; vendor preset: enabled)
Drop-In: /usr/lib/systemd/system/user@.service.d
└─timeout.conf
Active: active (running) since Tue 2020-05-19 02:32:22 EDT; 2 weeks 4 days ago
Docs: man:user@.service(5)
Main PID: 979 (systemd)
Status: "Startup finished in 2.213s."
Tasks: 179
Memory: 7.4G
CGroup: /user.slice/user-120.slice/user@120.service
├─at-spi-dbus-bus.service
│ ├─1154 /usr/libexec/at-spi-bus-launcher
│ ├─1159 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
│ └─1295 /usr/libexec/at-spi2-registryd --use-gnome-session
├─dbus.service
│ ├─1001 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
│ ├─1068 /usr/libexec/goa-daemon
│ ├─1104 /usr/libexec/goa-identity-service
│ ├─1284 /usr/libexec/ibus-portal
│ ├─1299 /usr/libexec/dconf-service
│ └─1317 /usr/bin/gjs /usr/share/gnome-shell/org.gnome.Shell.Notifications
├─gnome-keyring-ssh.service
│ └─1204 /usr/bin/gnome-keyring-daemon --start --components ssh
├─gnome-session-monitor.service
│ └─1198 /usr/libexec/gnome-session-ctl --monitor
├─gnome-shell-x11.service
│ ├─1226 /usr/bin/gnome-shell
│ ├─1276 ibus-daemon --panel disable --xim
│ ├─1279 /usr/libexec/ibus-dconf
│ ├─1282 /usr/libexec/ibus-x11 --kill-daemon
│ └─1409 /usr/libexec/ibus-engine-simple
├─gnome\x2dsession\x2dmanager.slice
│ └─gnome-session-manager@gnome-login.service
│ └─1215 /usr/libexec/gnome-session-binary --systemd-service --session=gnome-login
├─gsd-a11y-settings.service
│ └─1329 /usr/libexec/gsd-a11y-settings
├─gsd-color.service
│ └─1330 /usr/libexec/gsd-color
├─gsd-keyboard.service
│ └─1332 /usr/libexec/gsd-keyboard
├─gsd-media-keys.service
│ └─1333 /usr/libexec/gsd-media-keys
├─gsd-power.service
│ └─1334 /usr/libexec/gsd-power
├─gsd-print-notifications.service
│ ├─1336 /usr/libexec/gsd-print-notifications
│ └─1419 /usr/libexec/gsd-printer
├─gsd-rfkill.service
│ └─1337 /usr/libexec/gsd-rfkill
├─gsd-smartcard.service
│ └─1338 /usr/libexec/gsd-smartcard
├─gsd-sound.service
│ └─1342 /usr/libexec/gsd-sound
├─gsd-usb-protection.service
│ └─1347 /usr/libexec/gsd-usb-protection
├─gsd-wacom.service
│ └─1354 /usr/libexec/gsd-wacom
├─gsd-wwan.service
│ └─1356 /usr/libexec/gsd-wwan
├─gsd-xsettings.service
│ └─1358 /usr/libexec/gsd-xsettings
├─gvfs-afc-volume-monitor.service
│ └─1033 /usr/libexec/gvfs-afc-volume-monitor
├─gvfs-daemon.service
│ ├─1006 /usr/libexec/gvfsd
│ └─1021 /usr/libexec/gvfsd-fuse /run/user/120/gvfs -f -o big_writes
├─gvfs-goa-volume-monitor.service
│ └─1063 /usr/libexec/gvfs-goa-volume-monitor
├─gvfs-gphoto2-volume-monitor.service
│ └─1038 /usr/libexec/gvfs-gphoto2-volume-monitor
├─gvfs-mtp-volume-monitor.service
│ └─1058 /usr/libexec/gvfs-mtp-volume-monitor
├─gvfs-udisks2-volume-monitor.service
│ └─1023 /usr/libexec/gvfs-udisks2-volume-monitor
├─init.scope
│ ├─979 /lib/systemd/systemd --user
│ └─980 (sd-pam)
├─pulseaudio.service
│ └─991 /usr/bin/pulseaudio --daemonize=no --log-target=journal
├─tracker-miner-fs.service
│ └─993 /usr/libexec/tracker-miner-fs
└─xdg-permission-store.service
└─1302 /usr/libexec/xdg-permission-store