Frequent firefox crashes after upgrade to Ubuntu 22.04.
It looks that there is a memory leak. This is what I find in syslog:
May 5 14:08:18 xxx systemd-oomd[685]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/snap.firefox.firefox.c553b0b1-9931-4c5c-8e94-7f5bb31199a8.scope due to memory used (7727669248) / total (8280240128) and swap used (1934368768) / total (2147479552) being more than 90.00%
Is there a fix ?
Additional info:
$ LANG="en" free -h
total used free shared buff/cache available
Mem: 7.7Gi 4.6Gi 1.3Gi 120Mi 1.9Gi 2.8Gi
Swap: 2.0Gi 1.3Gi 749Mi
EDIT 1: memory usage of the firefox thread is slowly growing even when I'm not using it. It starts at 5.4%MEM and increases above 8% even when I do nothing. And then is "crashes".
EDIT 2: firefox was automatically upgraded to version 100, but the problem persist. Visual Studio Code was also terminated by systemd-oomd. Here are the log lines in syslog about the firefox termination:
May 5 17:44:56 xxx systemd-oomd[685]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/snap.firefox.firefox.f14473ec-b4cf-4b0f-8533-ef1e41302b4e.scope due to memory used (7814512640) / total (8280240128) and swap used (2032394240) / total (2147479552) being more than 90.00%
May 5 17:44:56 xxx systemd[3093]: snap.firefox.firefox.f14473ec-b4cf-4b0f-8533-ef1e41302b4e.scope: systemd-oomd killed 130 process(es) in this unit.
May 5 17:44:56 xxx systemd[3093]: snap.firefox.firefox.f14473ec-b4cf-4b0f-8533-ef1e41302b4e.scope: Consumed 2min 19.374s CPU time.
EDIT 3: according to this announcement, systemd-oomd requires that there is enough swap space to work properly. It may be that I don't have enough swap space because I upgraded and didn't do a fresh install. Is this the explanation ?
systemd-oomd
doing it's job. If it detects a program is using too much resources on your box; it's job is to kill it. Withfirefox
& browsers in general (in my experience) it's the extensions I found that caused ram leaks; so you can remove them.. myself I prefer using them.. I wrote about it a little here - https://ubuntu-mate.community/t/what-all-is-inbound-with-22-04/25130/3 (I used to monitor the RAM leaks in the same extensions in prior releases too & used to killfirefox
,chromium
etc myself -systemd-oomd
now does the killing for me) – guiverc May 05 '22 at 12:41