Here are instructions on how to manually switch from swap on zram to disk based swap with zswap enabled. This may help resolve some memory issues, as it allows data to be moved out of memory completely (freeing it for another use), rather than compressing it but keeping it in memory (what zram does). This worked for me on Bluefin, and I assume Bazzite is similar enough for this to work there too.
Step 1, switch off zram:
Create a file /etc/systemd/zram-generator.conf which overrides the system zram settings. The file can be empty. In mine I’ve put a comment to myself:
# This empty file overrides `/usr/lib/systemd/zram-generator.conf`.
Step 2, create a swapfile:
Assuming the system is using btrfs (this is the default on Bluefin, so I assume Bazzite is the same). Change the size to whatever makes sense for you.
sudo btrfs filesystem mkswapfile --size 8G /var/swapfile
Add the swapfile to /etc/fstab. The entry for me looks like this:
/var/swapfile none swap pri=0 0 0
Step 3, enable zswap (optional):
sudo rpm-ostree kargs --append='zswap.enabled=1'
Step 4, reboot.
Step 5, confirm settings:
The command cat /proc/swaps can confirm the active swap. It should now show only your swapfile.
Example:
> cat /proc/swaps
Filename Type Size Used Priority
/var/swapfile file 8388604 0 0
If you enabled zswap, check it is enabled:
> sudo dmesg | grep -F zswap
[ 0.000000] Command line: BOOT_IMAGE=(hd1,gpt5)/ostree/default-2ee8f203d4c5b97fd5fc04daf879a9dad7dc1c405c8aba2b6ddbda907ce9816e/vmlinuz-6.18.13-200.fc43.x86_64 rd.luks.uuid=luks-0c755fd5-99d6-4578-bb46-328eb72fd038 rd.lvm.lv=vg0/root rhgb quiet root=UUID=8e069d8e-b937-4ad1-a692-cd921ee55f6f rootflags=subvol=ub_root rw ostree=/ostree/boot.0/default/2ee8f203d4c5b97fd5fc04daf879a9dad7dc1c405c8aba2b6ddbda907ce9816e/0 rd.luks.options=discard zswap.enabled=1
[ 0.048097] Kernel command line: BOOT_IMAGE=(hd1,gpt5)/ostree/default-2ee8f203d4c5b97fd5fc04daf879a9dad7dc1c405c8aba2b6ddbda907ce9816e/vmlinuz-6.18.13-200.fc43.x86_64 rd.luks.uuid=luks-0c755fd5-99d6-4578-bb46-328eb72fd038 rd.lvm.lv=vg0/root rhgb quiet root=UUID=8e069d8e-b937-4ad1-a692-cd921ee55f6f rootflags=subvol=ub_root rw ostree=/ostree/boot.0/default/2ee8f203d4c5b97fd5fc04daf879a9dad7dc1c405c8aba2b6ddbda907ce9816e/0 rd.luks.options=discard zswap.enabled=1
[ 1.116601] zswap: loaded using pool lzo
I am not well enough informed of the tradeoffs to have opinions on whether the Bazzite defaults should be changed but I know that Chris Down recommends disk swap with zswap instead of zram (ref).