Outcome: You’ll enable compressed RAM swap (zram) so your Linux system stays responsive under memory pressure.

Who this is for: Ubuntu/Debian users on low-RAM laptops, mini PCs, or VMs (especially 4–8GB RAM).

Time required: About 5–10 minutes.

Quick Answer

Install zram-tools (or zram-config), restart the zram service or reboot, then verify with zramctl and swapon --show. If zram is active, your system can compress swap pages in RAM and reduce disk thrashing.

If your Linux machine slows to a crawl with multiple tabs or apps open, zram is one of the highest-impact fixes you can turn on quickly.

Prerequisites

  • Ubuntu or Debian-based Linux system
  • Sudo access
  • Kernel with zram support (common on modern Ubuntu/Debian installs)

The Single Trick: Turn On Zram Swap

  1. Update package lists.
    Run: sudo apt update
  2. Install the zram package.
    On most Ubuntu/Debian systems: sudo apt install -y zram-tools
    On some systems with older packaging: sudo apt install -y zram-config
  3. Apply the service.
    Run: sudo systemctl restart zramswap.service
    If that service name isn’t available, just reboot once: sudo reboot
  4. Verify zram is active.
    Run: zramctl
    Expected: a device like /dev/zram0 with a compression algorithm such as zstd.
  5. Verify swap is using zram.
    Run: swapon --show and free -h
    Expected: /dev/zram0 appears as swap and multitasking feels smoother.

Expected Result Checks

  • zramctl shows an active zram block device.
  • swapon --show lists zram swap.
  • Fewer freezes/stutters when opening many tabs/apps.
  • Less disk-swap churn during heavy memory use.

Common Mistakes

  • Installing but never rebooting/restarting: the change won’t apply immediately without that step.
  • Using the wrong package name: try zram-tools first, then zram-config.
  • Skipping verification commands: always check zramctl and swapon --show.
  • Expecting miracles on very old CPUs: compression helps memory pressure, but CPU limits still exist.

Troubleshooting

  • zramctl: command not found: install or reinstall util-linux and retry.
  • No zram device listed: run sudo systemctl status zramswap.service and reboot.
  • Only disk swap appears: confirm zram service is active, then re-run swapon --show.
  • Still feels slow: close startup-heavy apps and test again under the same workload.

Reference Links

Related Tech Tricks

Next Step

Keep zram enabled for a day, run your normal browser + app workload, and compare responsiveness. If performance improves, pair this with startup-app cleanup for an even bigger win.