On mobile operating systems, iOS / Android smartphone users have already experienced the power of crazy “background killing”. However, on Ubuntu 22.04 LTS distribution, Linux users are also frustrated that Systemd-OOMD kills applications during high memory/swap usage. So for the past month, developers have been trying to figure out an optimization strategy for Systemd-OOMD. In particular, to avoid abruptly killing software processes like VS Code and Firefox, which can make the user experience extremely bad.
Jammy has proposed a revision to systemd 249.11-0ubuntu3.4, and is currently setting “ManagedOOMSwap=auto” on the root slice (-.slice), and will push the update to stable releases soon.
Previously Ubuntu 22.04 LTS had been using “ManagedOOMSwap=kill” by default, resulting in the system always killing important application processes with high resource usage by mistake.
With the change, system-oomd’s default policy will be limited to monitoring memory pressure, rather than stretching its hands to blindly manage swap usage.
With the new policy of not terminating large swap usage or proposing to increase swap size, users will no longer see applications being terminated unexpectedly, and the Ubuntu Linux development team is exploring other suggestions and ideas.