Wednesday, August 7th, 2019, 9:25 am
I Never Had a Machine With More Than 2GB of RAM. But Phoronix Portrays GNU/Linux as Sucking on Memory Management.
The main problem is bloated software, not Linux
AST night I saw a somewhat ‘trollish’ bunch of reports. I saw Slashdot [1], linking to Phoronix [2] with a grammatical mistake in the headline (“Yes, Linux Does Bad In Low RAM / Memory Pressure Situations On The Desktop”).
Let me first clarify that I’m no kernel guru. Far from it. I’m a programmer, but not an OS programmer or kernel developer.
“Is this accurate?”
That’s what I asked people who may know better. They know kernel developers (and development) better than me.
“Is it true or is Phoronix taking the piss?”
I saw comments on it (almost 100 in Phoronix and 400 in Slashdot), but they’re short and vague. How is Linux doing compared to other OSes?
“ZSWAP makes a huge difference (RAM compression),” one person told me. “GRUB_CMDLINE_LINUX_DEFAULT="zswap.enabled=1 zswap.compressor=lz4 zswap.zpool=z3fold"
”
“Windows 10 & MacOS & Ubuntu have RAM compression on by default,” he added.
“I’m not sure exactly what they have,” he continued, “but I remember reading about it before. RAM compression isn’t new at all. But it is relatively new (few years) to be on by default.”
Linux kernel space is typically ahead of the curve (compared to the competition); Con Kolivas comes to mind when it comes to claims that it’s optimised for servers but not for desktops (the scheduler, not RAM/swap management).
To check compression status on one’s system:
grep -R . /sys/module/zswap/parameters;sudo dmesg|grep zswap; sudo grep -R . /sys/kernel/debug/zswap;f;sudo sh -c 'cd /sys/kernel/debug/zswap;perl -E "say $(cat stored_pages) * 4096 / $(cat pool_total_size)"' # to check if loaded ; used ; ZswapCompressionRatio
How can one argue that GNU/Linux does worse than counterparts? Slashdot promoted this story with about 400 comments and Phoronix even has a grammatical mistake in its headline (Slashdot corrected it, Michael of Phoronix has not.) It’s an eyesore in a sense; both the message and the English. The headline also states that as fact even though it’s to be attributed to just one developer, Artem S Tashkinov. To an outsider (to kernel development) it may smack of clickbait. It’s stigmatising “Linux” as not successful on “desktop” because of “technical” “issues” (not OEM bribes, ISVs etc.), but if it’s based on purely factual bits, then let it be, I’m fine with it.
My gut feeling was, there’s likely more to the story; can Apple and Microsoft handle compression of RAM for instance? If so, how well? I don’t know people running Apple-branded systems and PCs with Windows on just 2 gigabytes of RAM (which is the most I ever had on any of my systems; same with my wife, who is a GNU/Linux user).
Another person, who is proficient at kernel matters, told me: “I have caused Linux to stall in swap hell many times and there are long list of particular causes of it. facebook made oomd to attempt to deal with it in userspace.”
The first person weighed in again: “they should compare to other distros, and to MacOS/Windows. But the complaint is valid, IMO: that Linux (defaults) *should* be ‘smarter’ when OOM; check what is your vm.vfs_cache_pressure. $ cat /proc/sys/vm/vfs_cache_pressure
[...] I have mine set to 50, because this article makes sense to. (but I’m not sure what default is nowadays?)”
A third person wrote: “my Orange Pi with 2 GB of RAM running everything mainline is my main desktop, which runs generally fine with a swapfile of also 2 GB…”
That was in the #techrights
IRC channel this morning.
The person added, “the bigger question for me is why applications these days are so heavy and slow…”
That last point is what I too have raised many times before. GNU/Linux is handling reasonably well a complete system with 2GB of RAM (or less). Super-bloated applications is where things start getting trickier.
Related/contextual items from the news:
-
Linux Performs Poorly In Low RAM / Memory Pressure Situations On The Desktop
It’s been a gripe for many running Linux on low RAM systems especially is that when the Linux desktop is under memory pressure the performance can be quite brutal with the system barely being responsive. The discussion over that behavior has been reignited this week.
-
Yes, Linux Does Bad In Low RAM / Memory Pressure Situations On The Desktop
It’s been a gripe for many running Linux on low RAM systems especially is that when the Linux desktop is under memory pressure the performance can be quite brutal with the system barely being responsive. The discussion over that behavior has been reignited this week.
Developer Artem S Tashkinov took to the kernel mailing list over the weekend to express his frustration with the kernel’s inability to handle low memory pressure in a graceful manner. If booting a system with just 4GB of RAM available, disabling SWAP to accelerate the impact/behavior, and launching a web browser and opening new web pages / tabs can in a matter of minutes bring the system down to its knees.
August 7th, 2019 at 2:46 pm
IMHO When developers/coders will stop creating the stuff without any knowledge how to make it right then we’ll have no issues with RAM etc. for sure. Everything might be able to be optimized, but code written already optimized and carefully debugged is better and faster.
September 18th, 2019 at 3:25 pm
Tashkinov is not a developer and never been. He is a sysadmin from Russia without CS grade. He is also author of trash anti-Linux website.
September 27th, 2019 at 4:26 am
Back in 2008, when I started using Linux (SimplyMEPIS), I was amazed at how responsive the system always was with just 256 MB RAM, comparing to Windows XP.
But that changed later. When I had a laptop with 4 GB, I started noticing some slowdown. Today I have 12 GB, and when the usage reaches around 9 GB, or even less, I can already feel how laggy the desktop becomes, almost useless. I don’t know how other OSs handle this, but for years I have been struggling with memory management on Linux, to the point where I considering moving to a BSD or Haiku. I’ve tried many sysctl options, changing or disabling swap, etc., and some things help, but nothing really fixes the problem.