News for hackers. Stuff that matters.
Re:The Linux kernel's inability to gracefully handle low mem... by brendangregg on Monday August 05, 2019 @09:49PM (#20621297)
I don't think that's a fair comparison: Do you normally run OSX with the swap files completely disabled, or Windows with the pagefile completely disabled? That's what this bug is describing. I'd bet things get pretty nasty on OSX and Windows too, if you tried that.

Perhaps the real bug is that Linux distros make it easy to run swapless.

Re:The Linux kernel's inability to gracefully handle low mem... by throwaway2048 on Monday August 05, 2019 @09:54PM (#20621337)
The behavior is even worse if you leave swap enabled, as I already detailed in my post...
Re:The Linux kernel's inability to gracefully handle low mem... by Aaargh20318 on Tuesday August 06, 2019 @01:14AM (#20622344)
Isn’t iOS basically a flavor of macOS that runs without swap ?
Re:The Linux kernel's inability to gracefully handle low mem... by earenndil on Tuesday August 06, 2019 @01:35AM (#20622444)
Yes, but it's also a heavily integrated environment that aggressively quits background programs on memory pressure.
Re:The Linux kernel's inability to gracefully handle low mem... by Aaargh20318 on Tuesday August 06, 2019 @04:17AM (#20623257)
But isn't that exactly what the linked article advocates Linux should also do ?

Before quitting background applications it first sends them a request to free memory, in a well-behaved iOS program you use this to clean up your caches and ensure your don't use more RAM than you absolutely need. You should also suspend your state to disk when your app is backgrounded so you can just continue where you left off if your app is killed.

Many macOS apps also do this, you can forcefully restart a Mac and after a reboot it'll restore your session to pretty much the exact state you left it in, including any open 'unsaved' files.

Linux could implement a similar mechanism to signal apps to clean themselves up and maybe a 'save your state, you're about to get killed' signal.

Re:The Linux kernel's inability to gracefully handle low mem... by ken on Tuesday August 06, 2019 @12:36PM (#20626788)
> Linux could implement a similar mechanism to signal apps to clean themselves up and maybe a 'save your state, you're about to get killed' signal.

Isn't that pretty much what "memory.pressure_level" [1] is?

[1]: https://www.kernel.org/doc/Documentation/cgroup-v1/memory.tx...

Re:The Linux kernel's inability to gracefully handle low mem... by codedokode on Tuesday August 06, 2019 @02:28AM (#20622707)
That is the only working solution with HTML and JS based applications or apps using GC. Applications should save the state and quit (or be ready to quit) instead of using memory in backround mode.