desktop entry proposal: TerminateSafe=true key

Colin Walters walters at verbum.org
Fri May 7 07:15:56 PDT 2010


On Fri, May 7, 2010 at 10:04 AM, Lennart Poettering <mzkqt at 0pointer.de> wrote:
>
> Well, the OOM killer kills processes at its descretion, and it doesn't
> look into the desktop file of the process before doing that... ;-)

Yes; the current Linux OOM killer is stupid; it arises from a lack of
vertical integration in our software stack.

> And, as it turns out the kernel already has a per-process setting that
> allows you to adjust your likeliness of being killed first by the OOM
> killer. You can change it via writing to /proc/self/oom_adj.

Sure; the way I think this should work is that userspace is actively
involved in preventing the last-ditch Linux OOM killer from being
invoked; for example the desktop shell could simply kill TerminateSafe
applications if it gets a low-memory signal from the kernel.

> Which makes me wondering: how does your suggestion relate to the kernel
> setting, and why should a developer fiddle with your setting instead of
> the kernel setting?

The likelihood of your app being killed via oom_adj is orthogonal to
letting the operating system know that it's safe to kill your app,
because it's not going to lose user data.


More information about the xdg mailing list