Understanding Linux Compressed Swap: zswap vs zram Technical Comparison and Recommendations
By
javierhonduco
Hot, fresh, and worth queueing round the block for.
Summary
This article provides expert guidance on Linux memory management technologies zswap and zram, explaining their fundamental differences and offering practical recommendations. The author clarifies that zswap and zram are distinct approaches with different philosophies: zswap compresses pages before writing them to swap on disk, while zram creates a compressed block device in RAM. The key recommendation is to prefer zswap in most cases, reserving zram only for specific, well-understood use cases. The article addresses common misconceptions and provides technical explanations to help users make informed decisions about compressed swap technologies on Linux systems.
Key quotes
· 4 pulledIf in doubt, prefer to use zswap. Only use zram if you have a highly specific reason to.
zswap and zram are fundamentally different approaches with different philosophies.
I read your articles about memory management (swap) on Linux, finally some words from the expert :) instead of internet experts 'you have 32GB - disable it'.
It'd be nice to have a follow-up about zswap or zram … :) if they're good (on desktop with 32GB RAM or more), which one is better and why …
You might also wanna read
Direct Disk Installation: Creating a Linux Distro That Installs via curl > /dev/sda
The article describes a technical experiment where the author created a Linux distribution that can be installed by directly piping a disk i
NixOS: Appreciating Deterministic Package Management and System Reproducibility
The article explains why the author loves NixOS, emphasizing that their appreciation stems primarily from the Nix package manager rather tha
modetc: A Linux Kernel Module for Relocating Dotfiles While Maintaining Compatibility
modetc is a Linux kernel module that allows users to move dotfiles and other files to different locations while maintaining compatibility wi
FZF-Powered Shell Aliases and Functions for Simplified Systemctl Commands
This article presents a collection of shell aliases and functions that use fzf (fuzzy finder) to simplify systemctl commands for managing sy
Debian 13 Trixie Moves /tmp Directory to Memory-Based tmpfs Filesystem
Debian 13 "Trixie" introduces a significant change where the /tmp directory is now mounted as tmpfs, meaning it resides in memory (RAM) rath
How to Install Ubuntu Server 26.04 on Raspberry Pi: A Step-by-Step Guide
A practical guide for installing Ubuntu Server 26.04 on Raspberry Pi models. The article covers using Raspberry Pi Imager or direct download
