Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8015

Beta testing • Re: rpi-swap (Trixie only) - zram-based swap

$
0
0
I'm sorry, I'm not very familiar with zram. I have some questions and I hope to get some help.
1. If using the zram+file mode, does [Zram]MaxSizeMiB=2048 mean that [File].MaxSizeMiB needs to be greater than 2048?
2. My system memory is only 2G. Under the default settings of my device, zramsize is 2G. Will this affect my performance?
By default zram / file scales with the amount of RAM your device has. This has been tested on Model B Rev 1 / Zero 2 W with (256 MB/512 MB RAM respectively) up to a 16G Pi 5. The default MaxSizeMiB stops sizes getting too large on devices with > 2048 MB RAM.

Performance will be highly specific to your individual use-case and device. In general though, if you're doing a graphical boot from an SD-card then I suspect that zram+file will give far better performance than swapping to SD-card (swapfile conf). If you're feeling adventurous, you could even try setting [Zram] RamMultiplier as high as 2 and setting you vm.swappiness to ~150.
Because I wanted to set file.MaxSizeMiB to 1024, and my hard drive is not very large, I don't want to use up too much space. Then, zram.MaxSizeMiB remains at 2048. As far as I know, zram writes to the file regularly. Would this cause the file size to be insufficient? If the file size is insufficient, does it mean that some memory pages will be discarded?

Statistics: Posted by tt77forever — Wed Oct 22, 2025 2:21 am



Viewing all articles
Browse latest Browse all 8015

Trending Articles