The post alleges that this this is due to "aggressive swap". I suspect that the MacOS developers at Apple know their target hardware, so I'm wondering (if this is the situation) whether the developers realized it, but the product was shipped anyway.
FWIW, even as a developer who mostly stays out of the kernel, swap has long been on my mind for Linux laptops (e.g., keeping pre-SSD spinning-rust hard drives sleeping), and I pretty much always disable swap, even on desktops. Part of the rationale is, if I can't fit all the processes in (now) several gigabytes of RAM, something probably needs an OOM-euthanizing.
Swap is most useful, when you (almost) never look at the swapped out data again.
That might sound stupid, but it occurs often enough in practice: eg code or data structures that were only used when starting off the program in question.
An optimally coded program wouldn't benefit from this. But real world programs often do.
I wouldn't link the usefulness of swap to the quality of programs. It has a lot to do with user behavior. If a user opens 100 tabs in a web browser but never looks at most of them, swapping unused ones to disk if they don't fit in RAM anymore is a very useful behavior (considering the alternative is killing the entire program).
You could argue an optimally coded program should do this themselves, however, that is not so easy when multiple programs are running concurrently and fighting for RAM. On an 8GB machine, how much RAM should your web browser use? The answer is "it depends". If there are no other programs running, it can use all 8GB. If you are running an IDE, a chat client and a compiler in the background, it should probably be using less.
The individual programs don't have enough information to make this judgement call - and making very conservative estimates will lead to much more swapping than actually required. The operating system is in charge of allocating memory for all those programs and can effectively make the judgement of what should be swapped out or not.
I always disabled swap on Linux (back when I was using HDDs) because it was completely useless anyway. As soon as you ran out of RAM and it started using swap the entire system would grind to a halt and you'd basically have no choice but to restart it, killing all processes rather than just random ones.
There doesn't seem to have been any effort by Linux developers to fix that (e.g. provide a kernel level GUI to let you pick which processes to kill when out of RAM).
> There doesn't seem to have been any effort by Linux developers to fix that (e.g. provide a kernel level GUI to let you pick which processes to kill when out of RAM).
There is no and will be no GUI for that, especially considering that many linux devices do not have any.
However, that does not mean there is no effort to improve the situation. The main player here is, surprisingly, Facebook. Their effort is going to be integrated into systemd in the form of systemd-oomd and Fedora 34 is going to ship it enabled out of the box (see https://fedoraproject.org/wiki/Changes/EnableSystemdOomd).
FWIW, even as a developer who mostly stays out of the kernel, swap has long been on my mind for Linux laptops (e.g., keeping pre-SSD spinning-rust hard drives sleeping), and I pretty much always disable swap, even on desktops. Part of the rationale is, if I can't fit all the processes in (now) several gigabytes of RAM, something probably needs an OOM-euthanizing.