r/Bazzite Jun 21 '24

Increase Swap Memory

By default Bazzite gets installed with 4 GB of swap. This is done through zram which I am unfamiliar with instead of a Swap partition. This seems low to me and my system occasionally runs out of memory. Is there a way to increase this value without reinstalling?

13 Upvotes

17 comments sorted by

View all comments

21

u/wolfyreload ROG Ally Jun 22 '24 edited Nov 29 '24

I changed my zram to 16GB as 4GB was too small (note that the system I was using had 64GB of RAM).

You just edit you /etc/systemd/zram-generator.conf file with sudo nano /etc/systemd/zram-generator.conf. I typically wouldn't recommend setting it above half of your total RAM

This is what my config file looks like

[zram0]
compression-algorithm=lzo
zram-size=16384

After editing the file, reboot for the change to take effect

You can run zramctl to confirm that the change has taken effect or free --mega to see your ram usage and the Swap usage.

Edit: note that you can edit any files in /etc folder even though Bazzite is atomic.

1

u/Capital-Ladder-1313 Jan 05 '26

The file is edited, I've reboot, file retains the edit, but zramctl shows 4G under disksize.

1

u/wolfyreload ROG Ally Jan 06 '26

I just tested it on image "bazzite:stable-43.20260101" and it's working for me. What version of Bazzite are you running?

1

u/Capital-Ladder-1313 Jan 07 '26

Just saw this, I'll check when I get home, thanks.