Request for Fedora users with 8GB of RAM — is zram helping you?

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.

3 Likes

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.

What I’m specifically interested in is how much use it’s actually getting, and if there is size or other tuning we could adjust for the default.

On my 16gb system I rarely see more than a few k compressed, so I want to see more people’s experiences.

I use the default values. I never put much thought on it.

This is from my VM with 4GB of RAM, I use it for some light GUI work (gnome, firefox, terminal):

$ zramctl 
NAME       ALGORITHM DISKSIZE   DATA  COMPR  TOTAL STREAMS MOUNTPOINT
/dev/zram0 lzo-rle       1.9G 345.7M 105.9M 111.3M       4 [SWAP]

Not having disk swap in a VM helps a lot :+1:

1 Like

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.

1 Like

16GB X1 Carbon?

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. :fire: :computer: :fire:

NAME       ALGORITHM DISKSIZE DATA  COMPR  TOTAL STREAMS MOUNTPOINT
/dev/zram0 lzo-rle         4G   1G 282.2M 299.9M       8 [SWAP]
1 Like

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]
1 Like

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?

https://fedoraproject.org/wiki/Changes/Scale_ZRAM_to_full_memory_size#How_To_Test

1 Like

On my wife’s 8GB ThinkPad (soldered, cannot be expanded), I had to bump up the zram.

$ /sbin/zramctl 
NAME       ALGORITHM DISKSIZE  DATA  COMPR  TOTAL STREAMS MOUNTPOINT
/dev/zram0 lzo-rle         8G  2.7G 822.9M 857.3M       4 [SWAP]
1 Like

Fedora 41 LXDE Spin

Name             Algorithm  Disksize  Data   Compr  Total  Streams Mountpoint
/dev/zram0   lzo-rle         7,6G        4K        80B       12K    8                 [SWAP]

Fedora 41, Lenovo x250

✗ /sbin/zramctl 
NAME       ALGORITHM DISKSIZE  DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lzo-rle       7,2G  4,3G  1,5G  1,5G       4 [SWAP]

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.

Hi Matt,

Sure, you get faster swap performance, given :slight_smile: 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 … :slight_smile:

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 …

TBH I didn’t know I had this feature (or knew how to check it until now). I have 16 GB of RAM.

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 :laughing: ) I think you will be better off with a conventional swap file or partition.

Hi Melcar,


"... 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”
:rofl: