My linked
Wikipedia page writes:
When used for swap, zram … allows Linux to make more efficient use of RAM, since the operating system can then hold more pages of memory in the compressed swap than if the same amount of RAM had been used as application memory or disk cache. This is particularly effective on machines that do not have much memory.
--
david_1234 wrote: ↑Mon Sep 16, 2019 10:01 am
after download I need to change some setting ?
No, by installing the package
zram-config (with "dpkg --install" in the case of download, or with "apt" in case of being already in the apt-repository), a zram device is set up with a size up to half of your RAM size and used as swap device. I find this 50% setting to work well on my 1 GByte Pi3 and 4 GByte Pi4.
You can see the zram swap usuage with either the mentioned command:
…or by using:
Both commands also show that zram distributes its swap RAM to all CPU cores in order to maximize the speed of de-/compression in the swap RAM.
With the latter command you can furthermore fine-tune its usage. Please see its man-page:
man zramctl.