Windows and Mac use compressed RAM for many many years as standard.
Yet on many Linux desktop you have to activate it (namely ZRAM). It solves the problem that a e.g. browser eats all your memory. It's much quicker than Swap and yet mostly unknown by many people who are running a Linux desktop. As mentioned by another user it's still not standard on Ubuntu desktop and I don't understand why.
> It solves the problem that a e.g. browser eats all your memory.
It doesn't solve that. You get a little bit more headroom, but that's it. Not much ram is considered compressible anyway. On my Mac I'm barely reaching 10% of compressed memory anyway, so it doesn't make that much difference.
No offense, but you are being a very precise in defense but very broad in your (in general incorrect) claim.
The representation of an image sitting in memory will be a bitmap array, and for sure that will compress quite well. Video data as well but any decompressed frames are so transient I agree they won't benefit. ML-models don't compress well, but training data certainly does.
If you put aside mapping already compressed or non-compressable data into memory, all the rest of the things ram is used for can be compressed. Day to day you will have a lot of memory allocated that can be compressed. Most memory in use right now on most computers is compressible.
yes, it's not the ultimate solution but if your machine behaves in 98% of cases snappy and does not slow down vs. let's say only 70% of cases then that's a huge usability difference. Sometimes you just need a little headroom on top and not more. As some user point out it really depends on the workload and data etc. Browsers are a good example because in my experience browser cache can be compressed quite good.
which I find easier to setup. Just enable it and it manages itself. You can still keep swap on disk, but it will act as a buffer in between, trading CPU cycles for potentially reduced swap I/O.
I think Arch has it enabled by default, but I am not sure about that. I had to enable it manually on Tumbleweed because my rolling install is years old.
Fedora does that on some (but not all) disk/ram size combos. IIRC the installer won't put swap on nvme unless you tell it to explicitly, and will always set up the smaller of 4g or half of physical memory as zram.
Compressing data has a cost, right? Modern systems have a ridiculous amount of memory, if you are bumping into that limitation, it seems like something odd is happening.
If your web browser is using all your ram, it is probably misconfigured, maybe the ad-blocker has accidentally been turned off or something?
I run a Linux system with 2GB of RAM... and Intel integrated graphics, it's storage is not exceptionally fast flash. The more pages I can keep compressed in RAM, the less the CPU has to spend waiting on the storage, especially if we're talking about the swap partition. After letting that computer run a long time I can tell whats been swapped to disk versus just compressed to zswap.
> Modern systems have a ridiculous amount of memory
well it depends on your definition of modern, i suppose. i run Linux on a smartphone, which is about the most modern use of Linux i can think of, and hitting that 3-4 GB RAM limit is all too easy with anything touching the web, adblocker or not.
zram isn't exactly a trump card in that kind of environment, but it certainly makes the experience of saturating the RAM a lot nicer ("hm, this application's about half as responsive as it usually is. checks ram. oh, better close some apps/tabs i don't need." -- versus the default of the system locking for a full minute until the OOMkiller finishes reaping everything under the sun).
Yet on many Linux desktop you have to activate it (namely ZRAM). It solves the problem that a e.g. browser eats all your memory. It's much quicker than Swap and yet mostly unknown by many people who are running a Linux desktop. As mentioned by another user it's still not standard on Ubuntu desktop and I don't understand why.