Replies: 2 comments 7 replies
-
|
I agree that it makes sense, but I have never heard of anything like it. |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Actually, here is something: https://gitlab.freedesktop.org/hadess/low-memory-monitor ! Fedora and Debian seem to be shipping the package, but the git repo says it's archived. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Feature request in short: This isn't really a question limited to earlyoom, but as an app dev I wonder if in the freedesktop and Unix community as a whole, was there ever any design ideas floating around of a "memory low" signal?
How could it work: This could either be one of the signals like SIGUSR2 (although the default of many to just terminate the process is regrettable), or some dbus service thing to subscribe to (dbus can be complicated to hook into without kind of big helper libraries though), some Unix socket for any app that is interested to listen to, or something like that.
It should be some mechanism where before earlyoom needs to shoot down something, it can go to the top N big offenders that would be in the most favorite slots to shoot down soon, and tell them "hey, memory is running low, please adjust before my hand is forced". If one of the big offenders happens to understand the signal and reacts, then great, crisis averted. If none does, eventually the usual SIGTERM kicks in.
Why this could be great: I believe Android has this. It would be infinitely less jarring for the user, if e.g. a browser that may already be employing some sort of memory saver mechanism, would automatically turn it on or dial it up in response, and unload unused tabs for example.
Especially non-techie users won't understand why some programs just silently terminate, or they'll find it frustrating even if somebody explains to them that there's a good reason.
What alternatives might there be: I've seen some apps like Firefox attempt to implement this on their own, but usually it comes down to: 1. there is some weird corner case, like ZFS, that affects numbers weirdly so that for some users it'll do really undesirable things thinking there is low memory when there isn't, 2. therefore it's never ever going to be turned on by default ever.
Sadly, therefore I don't think a solution as some sort of library used by apps will ever work. Meanwhile, in earlyoom I think this can work, since e.g. a Linux distribution could ship a different default config for it when ZFS is picked in the distro installer, or something like that.
Summed up: Please consider implementing such a signal for apps to hook into, or perhaps it might be worth poking the freedesktop or systemd folks about some sort of unified plan to make this happen.
Beta Was this translation helpful? Give feedback.
All reactions