Smart dynamic swap management for Linux, written in Rust.
systemd-swap automatically configures the best swap strategy for your system:
- Auto-detection: Smartly chooses between Zswap and Zram based on your filesystem.
- Zswap + SwapFC: (Default for Btrfs/Ext4/XFS) Uses compressed RAM cache + dynamic swap files. Most efficient for desktops.
- Zram: (Default for others) Uses compressed RAM block device. Good for systems without disk swap support.
- Dynamic Scaling: Creates swap files on-demand, starting small and growing as needed.
cd pkgbuild
makepkg -siRequirements: Rust 1.70+, btrfs-progs, util-linux
cargo build --release
sudo make install
sudo systemctl enable --now systemd-swapCheck status:
systemd-swap statusReload configuration:
sudo systemctl restart systemd-swapConfiguration is located at /etc/systemd/swap.conf.
Change Swap Mode:
# Modes: auto, zswap+swapfc, zram, manuall
swap_mode=autoCustomize Zram Size:
zram_size=50%Customize Swap File Location:
swapfc_path=/mnt/data/swapfileSee /usr/share/systemd-swap/swap-default.conf for all available options and defaults.
- Zero Configuration: Works out of the box for most systems.
- Sparse Files: Swap files use zero disk space until data is actually written (when using Zswap).
- MGLRU Support: Integrates with Multi-Gen LRU (Kernel 6.1+) to prevent thrashing.
- Zram Writeback: Can offload cold pages from Zram to disk.
GPL-3.0-or-later