3 ms·
Which OS are you using? systemd-oomd (or similar) afaik is enabled in many modern releases and fixes it. The default settings (on Arch) make it kill stuff when
by phiresky 2mo ago
Which OS are you using? systemd-oomd (or similar) afaik is enabled in many modern releases and fixes it. The default settings (on Arch) make it kill stuff when your CPU is spending 60% of time on reclaiming memory over some time period. So you'll get 20 seconds of lag, then it is fixed.
By killing a program, yes, but how else do you expect it to work? If your RAM is not enough you have to kill stuff. And I really doubt you mean to say that Windows is _more RAM efficient_ than Linux, because that's kind of absurd. Maybe Firefox is less RAM efficient than Chrome.
Edit: MacOS I wouldn't doubt being better in RAM management than the others because they have been selling their devices with ridiculously low amounts of RAM for decades.
- eli_gottlieb 2mo agoCall me an old geezer but I remember having this thing called swap.
- Twirrim 2mo agoRight, and when it gets filled, the OOM killer comes along and does its thing.
- dwattttt 2mo agoOn some platforms. Others make other arrangements, with other tradeoffs. It's been less than 24 hours since an OOM killer was identified as responsible for a bug I was experiencing.
- a96 2mo agoAnd kills some vital process instead of killing the JVM or the web browser that actually ate all the (virtual) memory.
- nomel 2mo agoYeah, I'm super confused. Is the 34 year old solution to this (swap) somehow broken these days?
- stillpointlab 2mo ago> how else do you expect it to work How does it work on Windows and MacOS where I don't get the same freezes and random programs aren't killed by the OS? Because I'd expect it to work like that. There is this false dichotomy, a black and white kind of thinking on display. > And I really doubt you mean to say that Windows is _more RAM efficient_ than Linux What I'm saying ought to be clear to anyone willing to listen. My system should not get into an unrecoverable freezing state when I am doing routine tasks on a fresh install of an OS. And the community that is supposed to champion this OS should not then shift the blame to me if I complain about it.
- weinzierl 2mo ago"How does it work on Windows[..]" This video from Mark Russinovich is a classic explaining it. It is old but still relevant. https://m.youtube.com/watch?v=AjTl53I_qzY&ra=m https://m.youtube.com/watch?v=AjTl53I_qzY&ra=m "My system should not get into an unrecoverable freezing state[..]" There is a good precedent for what you want: Safety critical embedded systems. Your car ECU should not be in an unrecoverable freezing state when you want to break. These embedded systems also are known to be terribly memory inefficient because every bit of memory is statically assigned and never reused. So, it is not that what you want is impossible, it's just wasteful and expensive. Linux and Windows sit on slightly different points on this spectrum (opposite of said embedded systems) and what you perceive as Windows' better behavior under memory pressure has a price too.
- thereforegrin 2mo agoand killing programs and/or freezing the OS is somehow more efficient? By what metric? Certainly not by any UX or productivity one. I've moved to Linux from Windows some years ago but the first thing that shocked me was precisely the abysmal performance around low memory availability. Got my system stabilized eventually by means of some magical incantations but this wasn't a pleasant experience and I wouldn't want to repeat it. It's beyond me how come Linux is so decrepid in this particular area compared to Windows.
- hnlmorg 2mo ago
- chowells 2mo agoThe ideal would be to go into swap without becoming unresponsive, so that the user can quit a program of their choice to free memory. If you really want to make an issue out of it, do something like pre-X macOS, where it would provide a warning when you are getting close to running out of memory, so that a user might have the chance to do something before the current process starts getting swapped out.
- hnlmorg 2mo ago> The ideal would be to go into swap without becoming unresponsive, so that the user can quit a program of their choice to free memory. Linux already does this. The issue is when your swap is full too, or you’ve exhausted your RAM at such a rapid pace that the disk IO cannot keep up with the read and writes to swap. I’ve seen Windows choke under the same conditions too. > do something like pre-X macOS, where it would provide a warning when you are getting close to running out of memory, so that a user might have the chance to do something before the current process starts getting swapped out. This is where the desktop and the kernel being entirely separate organisations (not even projects, but literal organisations) makes things a touch harder. And those DEs aren’t even Linux specific either. So any tooling would have to portable (which, in fairness, should be possible with POSIX in this particular scenario). I think KDE does provide tools here for gracefully handling memory constraints. But that’s just one desktop environment of many.
- LtdJorge 2mo ago>> do something like pre-X macOS, where it would provide a warning when you are getting close to running out of memory And I've run out of memory while compiling packages (I'm looking at you, composable-kernel) on Gentoo. It's not like it can notify me and I close things in the milliseconds it takes for a few more GCC processes to spawn and allocate and fault all the remaining memory.
- eru 1mo ago> [...] or you’ve exhausted your RAM at such a rapid pace that the disk IO cannot keep up with the read and writes to swap. I don't know what that means. When your system is in such extreme memory pressure, it comes to a crawl, exactly because your memory use can't outpace your IO. There's no 'cannot keep up' state.
- Groxx 2mo agoFreeze as many applications as necessary to reserve room for the DE so I can choose what to do? Surely that's obvious to other people aside from me. It's an attended system, not a headless server in a rack hundreds of miles away that must not ever alert someone.
- drdexebtjl 2mo agomacOS shows a modal with a list of offending applications and how much RAM they're using. Some of those applications are "paused", marked in red, some are "not responding", and some are responding normally. You can pick applications from that list and choose between "Resume" (for "paused" applications) or "Force Quit". At no point the system becomes unresponsive.
- eru 1mo ago> At no point the system becomes unresponsive. That is, if you are lucky enough for the dialogue to pop up. I do agree that when you get the dialogue, it is a much better user experience than under Linux.
- LtdJorge 2mo agoFirefox is definitely more RAM efficient than Chrome, in my experience.
- deepsun 2mo agoLinux can, and does, prevent a program to claim any new memory. Like literally malloc() returns null. How program reacts to that is up to the program. Also I know linux has `cgroup_enable=memory` setting in /etc/default/grub, that's for Docker/K8S to be able to watch over containers RAM. It's not enabled by default as it slows down OS a little. Don't know if it's related to my first point.