desktop entry proposal: TerminateSafe=true key

Federico Mena Quintero federico at
Fri May 7 19:13:32 PDT 2010

On Fri, 2010-05-07 at 14:14 -0400, Colin Walters wrote:

> Why?  Don't get me wrong, I don't think that's the best heuristic ever
> conceived.  To a large extent, I think we need to make some rough
> attempts and see what actually works in the field.

"In the field" may be different things in different situations.

* Swapless phone with no overcommit?

* Fat desktop with gobs of RAM and swap?  ("the default for distros")

* Low-RAM maybe-a-bit-of-swap - OLPC?

Think about different things happening.

You are using your fat desktop.  You (possibly inadvertently) download a
huge-ass image which gets displayed in Firefox or EOG.  Most of
everything gets swapped out to make room for the uncompressed image.
But when you close the Firefox tab or EOG window, things gradually get
swapped back in and your machine goes back to normal.  It would be bad
to break this behavior by killing stuff.

You are using your desktop.  Some leaky daemon ends up using a lot of VM
but it keeps a small RSS.  It may be OK to kill it and have something
restart it.


I don't have a good solution, but just "TerminateSafe=true" seems rather
simplistic.  As Lennart said, the kernel can't even notify userspace
about memory pressure yet.

What's memory pressure, anyway?  You swapped everything out to make room
for the image; so what?  Do things thrash a lot while the image is
visible (meaning that you have a constantly-updating clock which needs
its code in RAM, a compositing manager which needs a ton of RAM to paint
a single pixel, etc?), or is the machine still usable even though most
RSSs got swapped?


More information about the xdg mailing list