Hey, Fedora users with laptops with 8GB of RAM — I’m curious if our new compressed-ram default is helping you. After you have been running for a long time and have lots of browser tabs open and other apps running (like normal daily use for several days), can you please run
/sbin/zramctl
and post the results? Thanks!
If you’re running something other than GNOME, note that too please.
I’d say yes if your swap is on SSD. By being compressed, it makes it that less data gets written to disk seeing that the first part of swap that is “written” to is into the zram. Until that gets filled, it’ll get written to the SSD.
So, to answer your question, both my machines running Fedora has 16GB of RAM, both have 17GB of swap, and 4 GB of zram that makes it to 21GB of swap.
On my system with the following spec’s
Memory: 7.8GiB
I get this from zramctl
/dev/zram0 lzo-rle 3.9G 4K 74B 12K 6 [SWAP]
I never really notice it to be honest. Not actually using the desktop much right now, so I can check it when I’m loading it up more, see if there is much of a difference in the numbers.
And with the usual (at this time) apps open and being used this is the difference. /dev/zram0 lzo-rle 3.9G 6.9M 988.3K 1.4M 6 [SWAP]
Still lots of room there.
16GB RAM, Fedora 33, i3 environment. Not what you asked for, but I seem to use the compression features a bit more than you have. I notice it most when Zoom, Slack, and other Electron-based apps get going.
NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lzo-rle 4G 1G 282.2M 299.9M 8 [SWAP]
A lenovo ideapad ryzen7-2700u laptop with 8GB of ram ( in reality 6,9 because some is shared with the graphics) with gnome, firefox, a document open, jupiter steam discord geary dejadup and a vm on backgroud, never have limitation because of the ram
/sbin/zramctl
NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lzo-rle 3,4G 3,2G 1,2G 1,2G 8 [SWAP]
If I have only gnome and a terminal I get:
/sbin/zramctl
NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lzo-rle 3,4G 489,6M 176,3M 365,5M 8 [SWAP]
Thanks everyone! Next thing: if you found your zram swap to be heavily used, can you follow the steps here to increase the limit (as planned for F34) to see what effect that has?
No Help at all in my setup …
Can’t see the point of putting swap in RAM … the entire point of swap was to set aside some disk space that could be used as virtual memory in the event that RAM was exhausted. Putting swap in RAM seems completely contrary to the purpose of swap space.
What is the logic of “Hey, I am running out of RAM and need more memory space, let’s just grab some more RAM and put it there…rinse and repeat”
Often, data in allocated memory can be compressed efficiently — 2:1, or even better. That can be faster than swapping to disk, even with fast solid-state storage. This is what zram does.
Sure, you get faster swap performance, given BUT …
if you are already having to swap, this would imply your are running out of RAM … so, what would be the point of putting more demand/pressure on RAM in the form of ZRAM for swap?
Seems pointless to me …
From past experiences with this, RAM full, ZRAM swap full, no swap on disk == system hangs or panics == no chance to recover by gracefully closing apps … high probability of corrupting disk/fs and data loss…
Yes, writing to even an NVME disk is slower than writing to RAM but even if it is slow it would be much better to gracefully recover by giving the user the ability to close apps before the system hangs/crashes/panics …
Zram seemed silly to me too and the documentation available is not that clear on many things. But the more I read about it, it kind of makes sense. It basically reduces your RAM footprint. Say you have 8GB of physical RAM and a 4GB zram block, you can have 4GB of compressed data in RAM. So know instead of you using up all your 8GB of RAM you will be using less. The decompression apparently is fast enough that even slow systems won’t be hampered, but I guess it depends on how much data you end up compressing/decompressing. Keep also in mind that you can set the zram to be bigger that your actual RAM.
In the end, it depends on your use case. If you are constantly eating up all your physical RAM and need large amounts of swap (just get more RAM already ) I think you will be better off with a conventional swap file or partition.
"... you can set the zram to be bigger that your actual RAM."
So, in fine *NIX/*NUX tradition “We assume you know what you are doing, so we will let you cut yourself with a sharp object by doing things that will make your situation worse”