September 27, 2023

COSFONE

Networking, Computer, PBX, IT, DIY Solution

Ubuntu 22.04 LTS frequently kills apps and developers are dealing with this issue

2 min read

Ubuntu 22.04 LTS frequently kills apps and developers are dealing with this issue



Ubuntu 22.04 LTS frequently kills apps and developers are dealing with this issue.

Ubuntu 22.04 LTS version brings a new feature: systemd-oomd is enabled by default as a daemon when memory is low, which can kill some processes in the case of high memory pressure.

However, the OOMD feature seems to kill apps crazily , sometimes even if the user does not feel any memory pressure, it will inexplicably terminate the running program, such as Firefox, Chrome or Visual Studio Code, users with very poor experience in the Ubuntu community mail Lots of comments on the list.

One frustrated user wrote :

There should be a warning before killing the app to have a chance to save app data. There should at least be an apology and explanation after killing the app. The current behavior gives the impression that Ubuntu 22.04 is unreliable and unsafe to use , which is a big problem for LTS releases.

Subsequently, Canonical engineer Nick Rosbrook explained in an email the conditions under which OOMD kills the process:

  • Condition 1: When both the total system memory usage and swap usage exceed the SwapUsedLimit (90% by default on Ubuntu), more than 5% of the swaps in cgoups will become OOM finalizers.
  • Condition 2: When a unit’s cgroup memory pressure exceeds MemoryPressureLimit, monitoring descendant cgroups will execute termination from the process with the most recycling rate.

In practice, most apps are killed because of condition 1, largely because Ubuntu only provides 1GB of swap space, and SwapUsedLimit is too easy to reach 90%.

Based on the termination conditions of the process, Nick proposed some ideas for changes, such as changing the way systemd-oomd calculates/triggering memory values, or increasing the value of SwapUsedLimit, because 1 GB is too little.

The community has now started an Ubuntu development thread on the issue to solicit feedback from the wider Ubuntu community, which should be resolved in the 22.04.1 update.




DISCLAIMER OF COSFONE.COM

Copyright © All rights reserved. | Newsphere by AF themes.