Swap files and ZRAM cause hibernate issues and memory pressure on NixOS
Problem
Users on NixOS encounter hibernate failures, excessive memory usage, and occasional system lock‑ups when using swap files or ZRAM, particularly on btrfs where swap files are unreliable.
Pain points
- Swap files on btrfs can cause hibernate failures or instability
- ZRAM fills up and keeps pages in RAM, creating memory pressure
- Tmpfs usage can lock up the system when large temporary files are stored
Questions to verify
- Do you experience hibernate failures when using swap files on a btrfs filesystem?
- Does ZRAM frequently fill up and cause the system to slow down or lock up in practice?
- Have you tried using a zswap+zstd combination, and did it resolve memory pressure issues?
Evidence
quote · @anonymous
swap files can complicate hibernate
quote · @anonymous
swap files on btrfs should probably be avoided whenever possible
quote · @anonymous
ZRAM is also a bad idea, when it is filled, the system starts swapping to a disk, and old pages nobody needs are kept in RAM forever.
Disclaimer: this card is distilled by AI from community discussions as “pain point evidence”. It is a starting point for need analysis and validation, not a “validated market need”. AI has analytical limits; please open the original discussion above to manually verify before key decisions.