{"slug": "zram", "name": "zram", "category": "os", "category_name": "Operating systems and desktop", "description": "", "recommenders": 6, "commenters": 17, "warners": 6, "score": 0.871, "rising": -0.64, "first": "2025-12-20", "latest": "2026-09-12", "why": "The latency of zram (compressed in memory) is still lower than the fastest SSDs which reduces those stalls.", "why_is_quote": true, "has_verdict": false, "sentiment": {"recommend": 6, "neutral": 1, "compare": 4, "warn": 6}, "spark": [0, 1, 0, 1, 0, 1, 0, 2, 0, 0, 1, 0], "listed": true, "loved": [], "caveat": "", "short_quote": "The latency of zram (compressed in memory) is still lower than the fastest SSDs which reduces those stalls.", "kind": "", "icon": false, "domain": "archlinux.org", "github_repo": null, "official_url": "https://docs.kernel.org/admin-guide/blockdev/zram.html", "pricing": "", "aliases": ["zram"], "verdict": null, "praise": [{"label": "", "summary": "", "quotes": [{"id": 794730640, "item_id": 49670665, "url": "https://news.ycombinator.com/item?id=49670665", "by": "Rohansi", "date": "2026-09-12", "version": null, "stance": "recommend", "quote": "The latency of zram (compressed in memory) is still lower than the fastest SSDs which reduces those stalls.", "excerpt": "Because it wouldn't soften the blow. Swap benefits the most from improved latency not bandwidth. Data is moved from swap back to physical RAM when swapped out pages are accessed by software (which stalls the thread). The kernel has less insight into the memory access pattern to prefetch the next page so the stalls likely continue for each page it needs to restore. The latency of zram (compressed in memory) is still l", "context": "", "use_case": "compressed swap", "switched_from": "", "story": "Stop making swap partitions\u2014use swap files instead"}, {"id": 779235762, "item_id": 48702235, "url": "https://news.ycombinator.com/item?id=48702235", "by": "anthk", "date": "2026-06-27", "version": null, "stance": "recommend", "quote": "Add ZRAM", "excerpt": "Add ZRAM https://wiki.archlinux.org/title/ZRAM", "context": "", "use_case": "", "switched_from": "", "story": "Linux on Older Hardware: The Complete Revival Guide"}, {"id": 779154705, "item_id": 48697169, "url": "https://news.ycombinator.com/item?id=48697169", "by": "ValdikSS", "date": "2026-06-27", "version": null, "stance": "recommend", "quote": "you'd want to do that on zram (compressed swap in RAM). It also make wonders.", "excerpt": "For HDD, it also needs to be tuned. In its default configuration, MGLRU 'just' manages multiple generations of working sets, but there's a min_ttl_ms tunable which tries hard to prevent file cache from being reclaimed, which is not enabled by default. https://docs.kernel.org/admin-guide/mm/multigen_lru.html#thrashing-prevention You'd want to set it to 300 or 500, or even 1000 for the HDDs. Around 100-200 for SSDs/EMM", "context": "", "use_case": "", "switched_from": "", "story": "Linux on Older Hardware: The Complete Revival Guide"}, {"id": 765556368, "item_id": 47847273, "url": "https://news.ycombinator.com/item?id=47847273", "by": "phh", "date": "2026-04-21", "version": null, "stance": "recommend", "quote": "Google strongly recommends using zram on all devices", "excerpt": "Well, you stopped hearing about it, not because it stopped being used, but because its support became mainstream for a very long time. Google strongly recommends using zram on all devices, even on devices with a lot of RAM since like Android 10?", "context": "", "use_case": "Linux memory compression", "switched_from": "", "story": "Reminder: Enable ZRAM on your Linux system to optimize RAM usage"}, {"id": 750370768, "item_id": 46898173, "url": "https://news.ycombinator.com/item?id=46898173", "by": "krautsauer", "date": "2026-02-05", "version": null, "stance": "recommend", "quote": "Have you tried zram swap?", "excerpt": "I rely on it heavily. Have you tried zram swap?", "context": "", "use_case": "", "switched_from": "", "story": "Modernizing Linux swapping: introducing the swap table"}]}], "caveats": [{"label": "", "summary": "", "quotes": [{"id": 794785969, "item_id": 49674123, "url": "https://news.ycombinator.com/item?id=49674123", "by": "tmtvl", "date": "2026-09-12", "version": null, "stance": "warn", "quote": "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": "", "switched_from": "", "story": "Stop making swap partitions\u2014use swap files instead"}, {"id": 789633441, "item_id": 49352090, "url": "https://news.ycombinator.com/item?id=49352090", "by": "mkesper", "date": "2026-08-18", "version": null, "stance": "warn", "quote": "zram and swap together can lead to priority inversion", "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": 783517936, "item_id": 48969871, "url": "https://news.ycombinator.com/item?id=48969871", "by": "fuzzy2", "date": "2026-07-19", "version": null, "stance": "warn", "quote": "It's also not the optimal choice in most situations", "excerpt": "It's also not the optimal choice in most situations: https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html", "context": "", "use_case": "Compressed RAM swap", "switched_from": "", "story": "The death and rebirth of my home server"}, {"id": 773249777, "item_id": 48328111, "url": "https://news.ycombinator.com/item?id=48328111", "by": "cromka", "date": "2026-05-29", "version": null, "stance": "warn", "quote": "Zram is buggy and still advised against regular use", "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": "", "switched_from": "", "story": "It's hard to justify buying a Framework 12"}]}], "who": [], "tags": [], "use_cases": ["compressed ram swap", "compressed swap", "linux memory compression", "swap on ssd laptop"], "compared": [{"slug": "zswap", "name": "zswap", "co": 13, "switched_from": 0, "switched_to": 0}], "makers": [], "threads": [{"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=47500746", "title": "Debunking Zswap and Zram Myths", "mentions": 3}, {"url": "https://news.ycombinator.com/item?id=48668747", "title": "Linux on Older Hardware: The Complete Revival Guide", "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=48966769", "title": "The death and rebirth of my home server", "mentions": 1}], "sentiment_by_month": {"2025-11": {}, "2025-12": {"recommend": 1, "compare": 1}, "2026-01": {}, "2026-02": {"warn": 1, "recommend": 1}, "2026-03": {"neutral": 1, "warn": 1, "compare": 1}, "2026-04": {"recommend": 1}, "2026-05": {"warn": 1}, "2026-06": {"recommend": 2}, "2026-07": {"warn": 1}, "2026-08": {"warn": 1}, "2026-09": {"compare": 2, "recommend": 1, "warn": 1}, "2026-10": {}}, "versions": [], "version_unnamed": 0, "family_ref": null, "runs_on": null, "lines": [], "quotes": [{"id": 794785969, "item_id": 49674123, "url": "https://news.ycombinator.com/item?id=49674123", "by": "tmtvl", "date": "2026-09-12", "version": null, "stance": "warn", "quote": "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": "", "switched_from": "", "story": "Stop making swap partitions\u2014use swap files instead"}, {"id": 794730640, "item_id": 49670665, "url": "https://news.ycombinator.com/item?id=49670665", "by": "Rohansi", "date": "2026-09-12", "version": null, "stance": "recommend", "quote": "The latency of zram (compressed in memory) is still lower than the fastest SSDs which reduces those stalls.", "excerpt": "Because it wouldn't soften the blow. Swap benefits the most from improved latency not bandwidth. Data is moved from swap back to physical RAM when swapped out pages are accessed by software (which stalls the thread). The kernel has less insight into the memory access pattern to prefetch the next page so the stalls likely continue for each page it needs to restore. The latency of zram (compressed in memory) is still l", "context": "", "use_case": "compressed swap", "switched_from": "", "story": "Stop making swap partitions\u2014use swap files instead"}, {"id": 794708913, "item_id": 49669307, "url": "https://news.ycombinator.com/item?id=49669307", "by": "lotharcable", "date": "2026-09-12", "version": null, "stance": "compare", "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": 794509585, "item_id": 49656849, "url": "https://news.ycombinator.com/item?id=49656849", "by": "cassianoleal", "date": "2026-09-11", "version": null, "stance": "compare", "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 RAM swap", "switched_from": "", "story": "Stop making swap partitions\u2014use swap files instead"}, {"id": 789633441, "item_id": 49352090, "url": "https://news.ycombinator.com/item?id=49352090", "by": "mkesper", "date": "2026-08-18", "version": null, "stance": "warn", "quote": "zram and swap together can lead to priority inversion", "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": 783517936, "item_id": 48969871, "url": "https://news.ycombinator.com/item?id=48969871", "by": "fuzzy2", "date": "2026-07-19", "version": null, "stance": "warn", "quote": "It's also not the optimal choice in most situations", "excerpt": "It's also not the optimal choice in most situations: https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html", "context": "", "use_case": "Compressed RAM swap", "switched_from": "", "story": "The death and rebirth of my home server"}, {"id": 779235762, "item_id": 48702235, "url": "https://news.ycombinator.com/item?id=48702235", "by": "anthk", "date": "2026-06-27", "version": null, "stance": "recommend", "quote": "Add ZRAM", "excerpt": "Add ZRAM https://wiki.archlinux.org/title/ZRAM", "context": "", "use_case": "", "switched_from": "", "story": "Linux on Older Hardware: The Complete Revival Guide"}, {"id": 779154705, "item_id": 48697169, "url": "https://news.ycombinator.com/item?id=48697169", "by": "ValdikSS", "date": "2026-06-27", "version": null, "stance": "recommend", "quote": "you'd want to do that on zram (compressed swap in RAM). It also make wonders.", "excerpt": "For HDD, it also needs to be tuned. In its default configuration, MGLRU 'just' manages multiple generations of working sets, but there's a min_ttl_ms tunable which tries hard to prevent file cache from being reclaimed, which is not enabled by default. https://docs.kernel.org/admin-guide/mm/multigen_lru.html#thrashing-prevention You'd want to set it to 300 or 500, or even 1000 for the HDDs. Around 100-200 for SSDs/EMM", "context": "", "use_case": "", "switched_from": "", "story": "Linux on Older Hardware: The Complete Revival Guide"}, {"id": 773249777, "item_id": 48328111, "url": "https://news.ycombinator.com/item?id=48328111", "by": "cromka", "date": "2026-05-29", "version": null, "stance": "warn", "quote": "Zram is buggy and still advised against regular use", "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": "", "switched_from": "", "story": "It's hard to justify buying a Framework 12"}, {"id": 765556368, "item_id": 47847273, "url": "https://news.ycombinator.com/item?id=47847273", "by": "phh", "date": "2026-04-21", "version": null, "stance": "recommend", "quote": "Google strongly recommends using zram on all devices", "excerpt": "Well, you stopped hearing about it, not because it stopped being used, but because its support became mainstream for a very long time. Google strongly recommends using zram on all devices, even on devices with a lot of RAM since like Android 10?", "context": "", "use_case": "Linux memory compression", "switched_from": "", "story": "Reminder: Enable ZRAM on your Linux system to optimize RAM usage"}, {"id": 760051201, "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": 760049921, "item_id": 47503120, "url": "https://news.ycombinator.com/item?id=47503120", "by": "prussian", "date": "2026-03-24", "version": null, "stance": "warn", "quote": "even if sub-optimal", "excerpt": "With zram, I can just use zram-generator[0] and it does everything for me and I don't even need to set anything up, other than installing the systemd generator, which on some distros, it's installed by default. Is there anything equivalent for zswap? Otherwise, I'm not surprised most people are just using zram, even if sub-optimal. [0]: https://crates.io/crates/zram-generator", "context": "", "use_case": "", "switched_from": "", "story": "Debunking Zswap and Zram Myths"}, {"id": 760023600, "item_id": 47501475, "url": "https://news.ycombinator.com/item?id=47501475", "by": "nephanth", "date": "2026-03-24", "version": null, "stance": "neutral", "quote": "I used to put swap on zram when my laptop had one of those early ssds", "excerpt": "I used to put swap on zram when my laptop had one of those early ssds, that people would tell you not to put swap on for fear of wearing them out Setup was tedious", "context": "", "use_case": "swap on SSD laptop", "switched_from": "", "story": "Debunking Zswap and Zram Myths"}, {"id": 750370768, "item_id": 46898173, "url": "https://news.ycombinator.com/item?id=46898173", "by": "krautsauer", "date": "2026-02-05", "version": null, "stance": "recommend", "quote": "Have you tried zram swap?", "excerpt": "I rely on it heavily. Have you tried zram swap?", "context": "", "use_case": "", "switched_from": "", "story": "Modernizing Linux swapping: introducing the swap table"}, {"id": 750370032, "item_id": 46898127, "url": "https://news.ycombinator.com/item?id=46898127", "by": "homebrewer", "date": "2026-02-05", "version": null, "stance": "warn", "quote": "zram has been \"obsolete\" for years", "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": 741961377, "item_id": 46372586, "url": "https://news.ycombinator.com/item?id=46372586", "by": "MrDrMcCoy", "date": "2025-12-23", "version": null, "stance": "compare", "quote": "The only times I use zram are when all I have to work with for storage is MMC", "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 RAM swap", "switched_from": "", "story": "Meta is using the Linux scheduler designed for Valve's Steam Deck on its servers"}, {"id": 741389328, "item_id": 46336833, "url": "https://news.ycombinator.com/item?id=46336833", "by": "ece", "date": "2025-12-20", "version": null, "stance": "recommend", "quote": "I use zram exclusively as swap", "excerpt": "Debugging what causes an OOM situation seems to be a wash with or without overcommit as an end user, I am guessing more warnings/hints would be appreciated by users and developers. I use zram exclusively as swap, and while doing memory intensive tasks in the background, it's usually something interactive like the browser that ends up being killed. I would turn on swap that's isn't zram if this happened more often. I ", "context": "", "use_case": "", "switched_from": "", "story": "Vm.overcommit_memory=2 is the right setting for servers"}]}