[HowTo] Install and configure zram using zram-generator

@cscs
The change only came about because I had marked the entry (text) from grub with the mouse, i.e. made it blue, and then pasted it here in the forum with the center wheel of the mouse. Not from DuckDuckGo or anything like that. Funny, but your keen eyes spotted the difference. Again, I think your post is great, the terminal is still outrageous to me, but I made it because you described everything in such nice detail.

1 Like

Reference: block device: zram disk benchmark.
2023.nov.

Screenshot from 2023-11-21 00-22-39

Reference: block device: zram disk benchmark.
It may not be very useful, but it’s a guideline.
My conclusion is that it’s better to format with XFS or EXT4.
BTRFS is no good.
I use zram-init, not zram-generator.

Current.

NAME           TYPE       SIZE USED  PRIO
/dev/zram0     partition 25.1G   8K 16383
/dev/nvme0n1p9 partition 73.2G  16K    -2
NAME       ALGORITHM DISKSIZE DATA  COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 zstd         25.1G  12K   232B   44K      24 [SWAP]
/dev/zram1 lzo-rle      15.6G   3M 414.5K  1.1M      24 /ZRAM

I use it to download iso files that I will delete immediately.
Use it with kvm and delete it.
As long as I use it normally, zram swap is not used. The main memory is 64GB. If you run 8 4K videos at the same time, it will be swapped.

Hello!
I have just worked my way through this nice little tutorial and can highly recommend it. If you follow each step carefully, it works. As soon as I rebooted, I experienced a nice performance boost. The numbers from the terminal commands confirm my feeling. I would almost say you can double your RAM with it and for free. You just have to do without hibernation, but I never used it anyway.
Thanks for the tutorial.

3 Likes