4

I've observed that my Firefox frequently closes by itself, and I'm not sure what's causing this; does anyone know what's going on?

I'm on Ubuntu 22.04 right now.

  • why not add some useful information about your setup and add some information about what happens before,during and after firefox closes. – trond hansen Apr 27 '22 at 14:17
  • Note the exact time of an event. Check your logs for around that time -- what do your logs say? – user535733 Apr 27 '22 at 14:34
  • @trondhansen it just as if i cosed the browser, and when you open the browser again; you have to restore your previous session; as though you closed it. – Cletus Kingdom Apr 27 '22 at 14:53
  • @user535733 please how do i get these logs? I'm unaware of how to get them. – Cletus Kingdom Apr 27 '22 at 14:54
  • All the logs are stored in the folder /var/log/. It might be crashing too, but normally that will pop up a message to send the error report. Those logs are stored in /var/log/crash – Terrance Apr 27 '22 at 15:55
  • @Terrance that would be /var/crash – heynnema Apr 27 '22 at 18:26
  • @heynnema Ah yes, you are correct. Silly me! :) – Terrance Apr 27 '22 at 19:45
  • You might want to check journalctl; it's possible the systemd-oomd daemon is killing the application unexpectedly if it's using too much memory. Check the output of journalctl | grep firefox | grep killed. – Kevin Ushey Apr 30 '22 at 03:55
  • 1
    I'm having the same issue in https://askubuntu.com/questions/1409332/22-04-how-to-see-log-of-why-firefox-sublimetext-are-quitting-possibly-due-to and don't see anything of relevance in /var/crash or by trying journalctl | grep firefox | grep killed – Vivek Gani May 18 '22 at 22:10
  • I had the same issue and not found any root cause. Its really frustrating and I have switched to using Chrome until someone can figure this out. – 2c00L May 27 '22 at 18:33

1 Answers1

0

Seems to be a memory issue. Your computer memory is being exhausted and this causes systemd-oomd.service to kill Firefox.

When you run journalctl | grep firefox | grep killed you may see an output similar to this

Jun 07 20:41:13 serv1-xx systemd[1619]: snap.firefox.firefox.4db4f773-3421-4fd2-af46-79a1aa3a0f00.scope: systemd-oomd killed 562 process(es) in this unit.
Jun 08 10:08:05 serv1-xx systemd[1619]: snap.firefox.firefox.a99aced6-ea5b-4a7e-b676-7e7b348b9886.scope: systemd-oomd killed 855 process(es) in this unit.
Jun 08 14:22:43 serv1-xx systemd[1619]: snap.firefox.firefox.c2cce8ce-d5b0-4d7e-ad7c-68d7f9edddd9.scope: systemd-oomd killed 449 process(es) in this unit.

Checking on this link systemd-oomd.service could be the killer https://www.freedesktop.org/software/systemd/man/systemd-oomd.service.html

So the systemd-oomd.service is responsible for killing your Firefox process probably.

A solution would be to upgrade the RAM of your box.

PS, I experience similar behavior for other apps I use mostly such as Brave, Slack, Termius etc

  • I'm using an 8GB RAM – Cletus Kingdom Jun 09 '22 at 12:02
  • 1
    If there are other memory intensive apps, 8GB can be exhausted really quickly. However,on further checking, I noted on another thread someone with a 32GB RAM also complaining about the same issue, and this lead me to the conclusion that systemd-oomd may also be a problem. See link below https://askubuntu.com/questions/1404888/how-do-i-disable-the-systemd-oom-process-killer-in-ubuntu-22-04

    So, I ended up disabling it altogether so it doesn't manage memory for me. sudo systemctl disable --now systemd-oomd

    – wwmwabini Jun 10 '22 at 05:46
  • For me the command does not return anything. The machine has 128 GiB of RAM which I suspect should be enough for a web browser, even nowadays. – Sussch Feb 24 '23 at 11:24