4 ms·
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'
by brendangregg 7y ago
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.
- throwaway2048 7y agoThe behavior is even worse if you leave swap enabled, as I already detailed in my post...
- Aaargh20318 7y agoIsn’t iOS basically a flavor of macOS that runs without swap ?
- earenndil 7y agoYes, but it's also a heavily integrated environment that aggressively quits background programs on memory pressure.
- codedokode 7y agoThat 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.
- Aaargh20318 7y agoBut 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.
- ken 7y ago> 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.txt https://www.kernel.org/doc/Documentation/cgroup-v1/memory.tx...