We’re Systemd-OOM’d, Say Ubuntu Users

Still waiting for Firefox to start? Read about why it might quit out on you.
6 July 2022

The seemingly random closure of programs and the loss of all your precious work is a problem with which Windows users are customarily familiar. These wild-eyed, reckless souls walk a high wire of project-death on a staggeringly regular basis. But Ubuntu users are more cautious with their creativity, and – especially when using Ubuntu 22.04 – they expect security, stability, and not to have to yell “What the actual living hell?! Where did my work go?!” with any notable regularity.

Welcome to your Ubuntu Desktop nightmare.

Welcome to OOMD – the random app killer of Olde Ubuntu Towne…

It’s Killing Time

Also known as systemd-OOM, which is too perfect to go unacknowledged, OOMD on Ubuntu 22.04 is not some random code mutation that ‘decides’ to go killing open apps just for badness and spite. It’s actually doing exactly what it’s supposed to do – killing seemingly inactive apps, to save the kernel from panic when it looks like there’s an issue with memory pressure on your system. If you want to anthropomorphize it, OOMD thinks it’s the conscientious deck hand, getting everyone to the lifeboats before the iceberg of critical memory threshold is hit and your whole world goes down into icy nothingness.

The troublesome part of the OOMD is that while it goes about killing apps (it kills the entire process tree) and swallowing any work done unsaved into the everlasting darkness of digital oblivion, it employs the same discretion as a Downton Abbey butler – no indiscrete pop-ups, warnings or whispered threats that either you save your work now or your code gets it. It just chomps like an app-killing PacMan, and there goes the neighborhood.

The Burden of Memory Pressure

As mentioned, in Windows, you live on the wild side of this potential fate most of the time, but in Ubuntu, and particularly Ubuntu 22.04 – a Long Term Support version of Ubuntu, which should be as unmoveable as a politician in a storm of protest – it’s not a fate you normally expect.

On the other hand, it’s a slight mischaracterization to say the OOMD kicks in when you have a spike in memory-usage. Instead, it’s triggered (again, technically as a memory-saving helper) by an increase in overall memory pressure over time, so you have to have been running Ubuntu for a while before it unleashes the OOMD on your apps. That’s why, for instance, there hasn’t been a whole rash of Ubuntu users reporting the issue and shouting at Canonical for the apparent instability of Ubuntu 22.04 desktop. You should probably be aware of memory pressure before it gets to a level where you’re triggering the OOMD, and many users are. But the unwary are still likely to get caught out by the no-warning app-killer.

A Maturing Issue

Nevertheless, it’s an issue that was first flagged at least a year ago, and has yet to be addressed by Canonical. There is naturally, significant hope that an upcoming update will tackle the issue, so that 22.04 is as robust as you’d expect it to be. From a handful of options that could see OOMD reduce its ferocity as a silent app-killer, the simplest in the short term would seem to be* to add more swap space on Ubuntu and increase swappiness, irrespective of how much physical memory you have. The simple addition of warnings ahead of an app-kill would be another user-friendly step.
*Not confirmed as a cure for OOMD woes at the time of writing.

There are also ways you can ensure OOMD doesn’t kill your apps right now. You can in fact deactivate the OOMD fairly simply, although that’s almost equivalent to turning off your turn signals to go driving in traffic. You can do it, and not have the inconvenience – but you lose out on a safety element if you do. There are reasons why systemctl requires superuser privileges, after all.

All Eyes On the Update

In Canonical’s defence, it hasn’t been using systemd OOMD for very long, and it may not yet have tweaked it to work seamlessly with Ubuntu 22.04 yet – again, hopes are being pinned on a point upgrade, now that the issue is not only out there, but relatively well documented, with the user community suggesting their own potential solutions. Even Fedora devs are pitching in with suggestions, and Ubuntu has upstreamed its suggested changes to the project.

One thing’s for sure, though – if the upgrade comes and goes with no remedy to the the app-hunger of the OOMD, that same community will want to know why.

Insult to injury?

This latest pothole in the road for Ubuntu users comes on top of the Firefox-as-a-Snap-by default issue which, aside from the debate around the whole implementation of Snaps by Canonical, is still frustrating users launching the browser for the first time.

One comfort for Canonical will be that Firefox users are unaffected by Systemd-OOMD, as they’re still waiting for their browser to load.