On my Raspberry Pi 4 8 gig version, my zram is 11.4 gig. I have an x86_64 machine with 8gig and my zram is nowhere near 11.4 gig in size with the systemd-swap app. Aarch64 uses the zswap-arm package. Is this only possible to do this on the Aarch64 architecture?
How do I set up zram, so it is like it is in the Aarch64 build?
I switched from systemd-swap to zram-generator and this is the custom config I made as follows:
# This file is part of the zram-generator project # https://github.com/systemd/zram-generator [zram0] # This section describes the settings for /dev/zram0. # # The maximum amount of memory (in MiB). If the machine has more RAM # than this, zram device will not be created. # # "host-memory-limit = none" may be used to disable this limit. This # is also the default. host-memory-limit = 7485 # The fraction of memory to use as ZRAM. For example, if the machine # has 1 GiB, and zram-fraction=0.25, then the zram device will have # 256 MiB. Values in the range 0.10–0.50 are recommended. # # The default is 0.5. zram-fraction = 0.5 # The maximum size of the zram device (in MiB). # # If host-memory times zram-fraction is greater than this, # the size will be capped to this amount; # for example, on a machine with 2 GiB of RAM and with zram-fraction=0.5, # the device would still be 512 MiB in size due to the limit below. # # The default is 4096. # max-zram-size = 512 # The compression algorithm to use for the zram device, # or leave unspecified to keep the kernel default. # compression-algorithm = lzo-rle [zram1] # This section describes the settings for /dev/zram1. # # host-memory-limit is not specifed, so this device will always be created. # Size the device to a tenth of RAM. zram-fraction = 0.5 # The file system to put on the device. If not specified, ext2 will be used. fs-type = ext2 # Where to mount the file system. If a mount point is not specified, # the device will be initialized, but will not be used for anything. mount-point = /run/compressed-mount-point ### END of Config ###
After I setup zram-generator I used swapon --show to view the zram after a reboot and it only shows /dev/zram0 but if I use zramctl it shows what follows:
NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram1 zstd 3.7G 1.2M 15.3K 80K 4 /run/compressed/mount/point
/dev/zram0 zstd 3.7G 4K 63B 4K 4 [SWAP]
NAME TYPE SIZE USED PRIO
/dev/zram0 partition 3.7G 0B 100
Why does swapon --show only displays the /dev/zram0 whereas zramctl shows both zram1 and zram0?
Also htop displays swap as 3.7g but if I change the meter to zram it displays 7.31g.
I wonder why that is? Maybe it displays the uncompressed amount of space?
In Raspberry Pi 4 edition of Manjaro htop displays swp as 11.4g with slightly more ram than my thinkpad at 7.63g. I wonder why htop displays differently between the two systems, maybe zswap-arm sets it up differently.