{"slug": "zswap", "name": "zswap", "category": "os", "category_name": "Operating systems and desktop", "description": "", "recommenders": 11, "commenters": 13, "warners": 1, "score": 9.39, "rising": 2.71, "first": "2025-12-23", "latest": "2026-09-12", "why": "I use zswap, which is a non-fixed intermediate layer between RAM and swap and worked great", "why_is_quote": true, "has_verdict": false, "sentiment": {"recommend": 12, "neutral": 1, "compare": 1, "warn": 0}, "spark": [0, 1, 0, 2, 1, 1, 2, 0, 0, 1, 4, 0], "listed": true, "loved": [], "caveat": "", "short_quote": "I use zswap, which is a non-fixed intermediate layer between RAM and swap and worked great", "kind": "", "icon": false, "domain": "kernel.org", "github_repo": null, "official_url": "https://docs.kernel.org/admin-guide/mm/zswap.html", "pricing": "", "aliases": ["zswap", "Zswap"], "verdict": null, "praise": [{"label": "", "summary": "", "quotes": [{"id": 794785968, "item_id": 49674123, "url": "https://news.ycombinator.com/item?id=49674123", "by": "tmtvl", "date": "2026-09-12", "version": null, "stance": "recommend", "quote": "Nah, zswap is way better than zram", "excerpt": "Nah, zswap is way better than zram: <https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html>.", "context": "", "use_case": "Compressed swap cache", "switched_from": "", "story": "Stop making swap partitions\u2014use swap files instead"}, {"id": 794708912, "item_id": 49669307, "url": "https://news.ycombinator.com/item?id=49669307", "by": "lotharcable", "date": "2026-09-12", "version": null, "stance": "recommend", "quote": "Zswap has improved to the point where it is now preferable over Zram.", "excerpt": "Zswap has improved to the point where it is now preferable over Zram. https://linuxblog.io/zswap-better-than-zram/ There is a few other people documenting the same thing if you look around. As far as Linux and swap goes, very generally speaking: if you don't have a application that specifically advises against having swap you are almost always better off with it. If you don't end up using it then it costs you almost ", "context": "", "use_case": "", "switched_from": "", "story": "Stop making swap partitions\u2014use swap files instead"}, {"id": 794657424, "item_id": 49666089, "url": "https://news.ycombinator.com/item?id=49666089", "by": "MrDrMcCoy", "date": "2026-09-11", "version": null, "stance": "recommend", "quote": "Zswap is even better than that. Give it a try sometime.", "excerpt": "Zswap is even better than that. Give it a try sometime.", "context": "", "use_case": "Swap memory compression", "switched_from": "", "story": "Stop making swap partitions\u2014use swap files instead"}, {"id": 794509584, "item_id": 49656849, "url": "https://news.ycombinator.com/item?id=49656849", "by": "cassianoleal", "date": "2026-09-11", "version": null, "stance": "recommend", "quote": "Or zswap instead of zram.", "excerpt": "> switch swapp off and use zram instead Or zswap instead of zram. https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html https://linuxblog.io/zswap-better-than-zram/", "context": "", "use_case": "Compressed swap cache", "switched_from": "", "story": "Stop making swap partitions\u2014use swap files instead"}, {"id": 789633440, "item_id": 49352090, "url": "https://news.ycombinator.com/item?id=49352090", "by": "mkesper", "date": "2026-08-18", "version": null, "stance": "recommend", "quote": "Better use zswap", "excerpt": "Better use zswap, as zram and swap together can lead to priority inversion. https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html (found via lwn.net)", "context": "", "use_case": "", "switched_from": "", "story": "Linux 7.3 improves performance when running out of vRAM"}]}], "caveats": [{"label": "", "summary": "", "quotes": [{"id": 760090576, "item_id": 47505661, "url": "https://news.ycombinator.com/item?id=47505661", "by": "bilegeek", "date": "2026-03-24", "version": null, "stance": "warn", "quote": "I had issues getting it to use zstd at boot", "excerpt": "Kernel arguments are the primary method: https://wiki.archlinux.org/title/Zswap#Using_kernel_boot_parameters Snag: I had issues getting it to use zstd at boot. Not sure if it's a bug or some peculiarity with Debian. Ended up compiling my own kernel for other reasons, and was finally able to get zstd by default, but otherwise I'd have to make/add it to a startup script.", "context": "", "use_case": "", "switched_from": "", "story": "Debunking Zswap and Zram Myths"}]}], "who": [{"by": "mixmastamyk", "context": "Runs 16GB machine with VMs and many workloads", "url": "https://news.ycombinator.com/item?id=48332328", "date": "2026-05-29"}], "tags": [], "use_cases": ["compressed swap cache", "swap memory compression", "linux memory compression", "compressed swap"], "compared": [{"slug": "zram", "name": "zram", "co": 13, "switched_from": 0, "switched_to": 0}], "makers": [{"id": 760055952, "item_id": 47503497, "url": "https://news.ycombinator.com/item?id=47503497", "by": "cdown", "date": "2026-03-24", "version": null, "stance": "neutral", "quote": "which decouples zswap from its backing store entirely", "excerpt": "This is actually something we're actively working on! Nhat Pham is working on a patch series called \"virtual swap space\" (https://lwn.net/Articles/1059201/) which decouples zswap from its backing store entirely. The goal is to consolidate on a single implementation with proper MM integration rather than maintaining two systems with very different failure modes. It should be out in the next few months, hopefully.", "context": "", "use_case": "Linux kernel swap compression", "switched_from": "", "story": "Debunking Zswap and Zram Myths"}], "threads": [{"url": "https://news.ycombinator.com/item?id=47500746", "title": "Debunking Zswap and Zram Myths", "mentions": 6}, {"url": "https://news.ycombinator.com/item?id=49618087", "title": "Stop making swap partitions\u2014use swap files instead", "mentions": 4}, {"url": "https://news.ycombinator.com/item?id=48323869", "title": "It's hard to justify buying a Framework 12", "mentions": 2}, {"url": "https://news.ycombinator.com/item?id=46896586", "title": "Modernizing Linux swapping: introducing the swap table", "mentions": 2}, {"url": "https://news.ycombinator.com/item?id=49342719", "title": "Linux 7.3 improves performance when running out of vRAM", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=47828151", "title": "Reminder: Enable ZRAM on your Linux system to optimize RAM usage", "mentions": 1}], "sentiment_by_month": {"2025-11": {}, "2025-12": {"recommend": 1}, "2026-01": {}, "2026-02": {"recommend": 2}, "2026-03": {"neutral": 1, "compare": 1, "recommend": 1}, "2026-04": {"recommend": 1}, "2026-05": {"recommend": 2}, "2026-06": {}, "2026-07": {}, "2026-08": {"recommend": 1}, "2026-09": {"recommend": 4}, "2026-10": {}}, "versions": [], "version_unnamed": 0, "family_ref": null, "runs_on": null, "lines": [], "quotes": [{"id": 794785968, "item_id": 49674123, "url": "https://news.ycombinator.com/item?id=49674123", "by": "tmtvl", "date": "2026-09-12", "version": null, "stance": "recommend", "quote": "Nah, zswap is way better than zram", "excerpt": "Nah, zswap is way better than zram: <https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html>.", "context": "", "use_case": "Compressed swap cache", "switched_from": "", "story": "Stop making swap partitions\u2014use swap files instead"}, {"id": 794708912, "item_id": 49669307, "url": "https://news.ycombinator.com/item?id=49669307", "by": "lotharcable", "date": "2026-09-12", "version": null, "stance": "recommend", "quote": "Zswap has improved to the point where it is now preferable over Zram.", "excerpt": "Zswap has improved to the point where it is now preferable over Zram. https://linuxblog.io/zswap-better-than-zram/ There is a few other people documenting the same thing if you look around. As far as Linux and swap goes, very generally speaking: if you don't have a application that specifically advises against having swap you are almost always better off with it. If you don't end up using it then it costs you almost ", "context": "", "use_case": "", "switched_from": "", "story": "Stop making swap partitions\u2014use swap files instead"}, {"id": 794657424, "item_id": 49666089, "url": "https://news.ycombinator.com/item?id=49666089", "by": "MrDrMcCoy", "date": "2026-09-11", "version": null, "stance": "recommend", "quote": "Zswap is even better than that. Give it a try sometime.", "excerpt": "Zswap is even better than that. Give it a try sometime.", "context": "", "use_case": "Swap memory compression", "switched_from": "", "story": "Stop making swap partitions\u2014use swap files instead"}, {"id": 794509584, "item_id": 49656849, "url": "https://news.ycombinator.com/item?id=49656849", "by": "cassianoleal", "date": "2026-09-11", "version": null, "stance": "recommend", "quote": "Or zswap instead of zram.", "excerpt": "> switch swapp off and use zram instead Or zswap instead of zram. https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html https://linuxblog.io/zswap-better-than-zram/", "context": "", "use_case": "Compressed swap cache", "switched_from": "", "story": "Stop making swap partitions\u2014use swap files instead"}, {"id": 789633440, "item_id": 49352090, "url": "https://news.ycombinator.com/item?id=49352090", "by": "mkesper", "date": "2026-08-18", "version": null, "stance": "recommend", "quote": "Better use zswap", "excerpt": "Better use zswap, as zram and swap together can lead to priority inversion. https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html (found via lwn.net)", "context": "", "use_case": "", "switched_from": "", "story": "Linux 7.3 improves performance when running out of vRAM"}, {"id": 773317248, "item_id": 48332328, "url": "https://news.ycombinator.com/item?id=48332328", "by": "mixmastamyk", "date": "2026-05-29", "version": null, "stance": "recommend", "quote": "zswap works well in my experience.", "excerpt": "zswap works well in my experience. Don't need both. Combined with systemd-oomd I haven't had a swapping or memory issue in many years. 16gb here with VMs and lots going on. This doc clears some things up: https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html", "context": "Runs 16GB machine with VMs and many workloads", "use_case": "Swap memory compression", "switched_from": "", "story": "It's hard to justify buying a Framework 12"}, {"id": 773249778, "item_id": 48328111, "url": "https://news.ycombinator.com/item?id=48328111", "by": "cromka", "date": "2026-05-29", "version": null, "stance": "recommend", "quote": "Zsawp itself is enabled by default in Asahi.", "excerpt": ">You have a buggy program. As in memory leak? No. > Zswap has been available for quite a while. Zsawp is not Zram, which is a distant relative of the macOS on-the-fly compression I was talking about. Zram is buggy and still advised against regular use (https://www.reddit.com/r/AsahiLinux/comments/1i3mdrw/comment/m7plkkx, https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html). Zsawp itself is enabled b", "context": "", "use_case": "Linux memory compression", "switched_from": "", "story": "It's hard to justify buying a Framework 12"}, {"id": 765259936, "item_id": 47828746, "url": "https://news.ycombinator.com/item?id=47828746", "by": "Kim_Bruning", "date": "2026-04-19", "version": null, "stance": "recommend", "quote": "Zswap is supposed to degrade more gracefully.", "excerpt": "There's also kernel zswap, right? https://www.kernel.org/doc/html/latest/admin-guide/mm/zswap.html Oh right, definitely. Chrisdown wrote an article comparing the two: https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html Zswap is supposed to degrade more gracefully. There's even some HN comments on it: https://news.ycombinator.com/item?id=47500746", "context": "", "use_case": "Compressed swap cache", "switched_from": "", "story": "Reminder: Enable ZRAM on your Linux system to optimize RAM usage"}, {"id": 760117760, "item_id": 47507360, "url": "https://news.ycombinator.com/item?id=47507360", "by": "stdbrouw", "date": "2026-03-24", "version": null, "stance": "recommend", "quote": "I do like that zswap works alongside regular swap", "excerpt": "I get the impression that most desktop users enable zram or zswap to get a little bit more out of their RAM but there is never any real worry about OOM, not regularly anyway, so then (according to the principles laid out in the article) it shouldn't matter much. On my workstation, I run statistical simulations in R which can be wasteful with memory and cause a lot of transient memory pressure, and for that scenario I", "context": "", "use_case": "Compressed swap cache", "switched_from": "", "story": "Debunking Zswap and Zram Myths"}, {"id": 760113952, "item_id": 47507122, "url": "https://news.ycombinator.com/item?id=47507122", "by": "stdbrouw", "date": "2026-03-24", "version": null, "stance": "recommend", "quote": "It doesn't really need any config on most distros, no.", "excerpt": "It doesn't really need any config on most distros, no. That said, if you want it to behave at its best when OOM, it does help to tweak vm.swappiness, vm.watermark_scale_factor, vm.min_free_kbytes, vm.page-cluster and a couple of other parameters. See e.g. https://makedebianfunagainandlearnhowtodoothercoolstufftoo.computer/doku.php?id=start:memmanagement https://documentation.suse.com/sles/15-SP7/html/SLES-all/cha-tun", "context": "", "use_case": "compressed swap", "switched_from": "", "story": "Debunking Zswap and Zram Myths"}, {"id": 760090576, "item_id": 47505661, "url": "https://news.ycombinator.com/item?id=47505661", "by": "bilegeek", "date": "2026-03-24", "version": null, "stance": "warn", "quote": "I had issues getting it to use zstd at boot", "excerpt": "Kernel arguments are the primary method: https://wiki.archlinux.org/title/Zswap#Using_kernel_boot_parameters Snag: I had issues getting it to use zstd at boot. Not sure if it's a bug or some peculiarity with Debian. Ended up compiling my own kernel for other reasons, and was finally able to get zstd by default, but otherwise I'd have to make/add it to a startup script.", "context": "", "use_case": "", "switched_from": "", "story": "Debunking Zswap and Zram Myths"}, {"id": 760051200, "item_id": 47503200, "url": "https://news.ycombinator.com/item?id=47503200", "by": "guenthert", "date": "2026-03-24", "version": null, "stance": "compare", "quote": "zswap performs better when using a fast NVMe device as swap device and zram remains superior for devices with slow or no swap device.", "excerpt": "> The LRU inversion argument is just plain from the code presented and a logical consequence of how swap priority and zram's block device architecture interact, I'm not sure numbers would add much there. Yes, while it is all very plausible, the run times of a given workload (on a given, documented system) known to cause memory pressure to the point of swapping with vanilla Linux (default swappiness or some appropriat", "context": "", "use_case": "", "switched_from": "", "story": "Debunking Zswap and Zram Myths"}, {"id": 760042928, "item_id": 47502683, "url": "https://news.ycombinator.com/item?id=47502683", "by": "bilegeek", "date": "2026-03-24", "version": null, "stance": "neutral", "quote": "you can mostly disable zswap writeback", "excerpt": "Counterargument: you can mostly disable zswap writeback, so it will only use the swap partition when hibernating[1]. [1]https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Disable_zswap_writeback_to_use_the_swap_space_only_for_hibernation", "context": "", "use_case": "", "switched_from": "", "story": "Debunking Zswap and Zram Myths"}, {"id": 750370400, "item_id": 46898150, "url": "https://news.ycombinator.com/item?id=46898150", "by": "JamesTRexx", "date": "2026-02-05", "version": null, "stance": "recommend", "quote": "I use zswap, which is a non-fixed intermediate layer between RAM and swap and worked great", "excerpt": "I use zswap, which is a non-fixed intermediate layer between RAM and swap and worked great on my old laptop which had a max of 4GB RAM. Even use it now on my current 32GB laptop. Full compression would be nicer, but I'd also like to see ECC emulation (or alternative) as a cheaper alternative to the real hardware, although with current prices that might be less so.", "context": "", "use_case": "", "switched_from": "", "story": "Modernizing Linux swapping: introducing the swap table"}, {"id": 750370033, "item_id": 46898127, "url": "https://news.ycombinator.com/item?id=46898127", "by": "homebrewer", "date": "2026-02-05", "version": null, "stance": "recommend", "quote": "Linux supports proper memory compression in the form of zswap", "excerpt": "zram has been \"obsolete\" for years, I don't know why people still reach for it. Linux supports proper memory compression in the form of zswap https://wiki.archlinux.org/title/Zswap", "context": "", "use_case": "", "switched_from": "", "story": "Modernizing Linux swapping: introducing the swap table"}, {"id": 741961376, "item_id": 46372586, "url": "https://news.ycombinator.com/item?id=46372586", "by": "MrDrMcCoy", "date": "2025-12-23", "version": null, "stance": "recommend", "quote": "Zswap is arguably better.", "excerpt": "Zswap is arguably better. It confers most of the benefits of zram swap, plus being able to evict to non-RAM if cache becomes more important or if the situation is dire. The only times I use zram are when all I have to work with for storage is MMC, which is too slow and fragile to be written to unless absolutely necessary.", "context": "", "use_case": "Compressed swap cache", "switched_from": "", "story": "Meta is using the Linux scheduler designed for Valve's Steam Deck on its servers"}]}