24
  • I've just installed Ubuntu 22.04 on my laptop with 8GB ram (no dual boot, ext4 + 20GB linux swap);
  • Installed 2 gnome shell extensions (Dash to panel, Workspace Matrix);
  • My working environment is just vs code, webpack dev server, and chrome;
  • During the active development something dies ~ every 10 minutes. Could not find any error logs, it looks like app is closed (in case of webpack dev server the terminal window is closed). If it's chrome - no chrome processes left.
  • For now, it did not happen with the active app - only background ones die. It's like you save a code, switch to the browser - and there's no browser, or you inspect something in devtools, switch to vs code - and there's no vs code.

What should be the first step investigating this? Where to look for any logs/crash reports?

Kasheftin
  • 353

3 Answers3

26

I had the same problem, and it turned out that systemd-oomd (a userspace out-of-memory (OOM) killer) was killing my applications whenever I was running low on swap space.

As suggested by @guiverc, you can run the following command to see if it is the case for you as well:

journalctl -u systemd-oomd

Example output:

mai 09 07:03:25 caterpillar systemd[1]: Starting Userspace Out-Of-Memory (OOM) Killer...
mai 09 07:03:26 caterpillar systemd[1]: Started Userspace Out-Of-Memory (OOM) Killer.
mai 09 14:05:24 caterpillar systemd-oomd[573]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/snap.firefox.firefox.d00df170-f05e-4de1-a1c8-4c1d53664dc1.scope due to memory used (7277371392) / to>
mai 10 10:32:34 caterpillar systemd-oomd[573]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/snap.firefox.firefox.4fad3166-da1d-4084-8a67-8a2ddfe4ab68.scope due to memory used (7352815616) / to>

Two options:

  1. Disable systemd-oomd:

    systemctl disable --now systemd-oomd
    

    For more information: How do I disable the systemd OOM process killer in Ubuntu 22.04?

  2. Increase swap size (recommended).

Pablo Bianchi
  • 17,371
0

apparently the systemctl disable --now systemd-oomd does not persist on reboot, so we need to do:

sudo systemctl mask systemd-oomd.service

source: https://youtu.be/XotltmuFUyU?t=794

0

For me problem was to small swap file size. Try increasing swap file size first.

Also, some apps (i.e. slack) when installed over snap are very unstable. Try downloading install directly from their website.

MilanG
  • 101