Logo

How to Change Swap (ZRAM) Size on Fedora 40

Mar 21, 2024

To Change Swap (ZRAM) Size on Fedora 40

Step 1 : By default, Fedora 40 enables ZRAM. Verify its status:

systemctl status systemd-zram-setup@zram0.service

Step 2 : Check the current memory status:

free -m

Step 3 : Edit the ZRAM configuration file:

sudo nano /usr/lib/systemd/zram-generator.conf

- Modify the 'zram-size' parameter to adjust the swap size according to your requirements.

Step 4 : Reload systemd:

sudo systemctl daemon-reload

Step 5 : Restart ZRAM service:

sudo systemctl restart systemd-zram-setup@zram0.service

Step 6 : Confirm the changes by checking the swap status:

sudo swapon --show

Congratulations! You have successfully adjusted the ZRAM swap size on Fedora 40.

Recommended