Table of Contents

Running Linux on Low RAM

Keeping a machine with 4-8 GB of soldered RAM responsive: the goal is never hitting the disk-thrash-frozen-UI cliff.

earlyoom: Install This First

The kernel's own OOM killer waits too long. By the time it fires the desktop has been frozen for minutes. earlyoom kills the biggest process before that:

sudo apt install earlyoom
sudo systemctl enable --now earlyoom
journalctl -u earlyoom        # see what it has killed

Defaults are reasonable: SIGTERM under 10% memory+swap, SIGKILL at 5%. Tune in /etc/default/earlyoom (EARLYOOM_ARGS=“-m 10 -s 10”).

zram: Compressed RAM Swap

sudo apt install zram-tools
zramctl
swapon --show            # should list /dev/zram0

Creates a compressed swap device in RAM (~50% of RAM by default, tunable via PERCENTAGE in /etc/default/zramswap). Swap hits it before disk and it decompresses fast. Paired with vm.swappiness=10, disk swap is a last resort.

Know the Budget

free -h                          # watch 'available', not 'free'
ps aux --sort=-%mem | head -10   # biggest users right now

On a light desktop the base system takes ~500 MB; the browser takes everything else. A handful of heavy tabs is usually the whole story.

Browser Discipline

If It Froze Anyway

1. Wait ~30 seconds. earlyoom may still be chewing.
2. ''Ctrl+Alt+F3'' -> log in -> ''htop'' -> kill the hog (''F9'' -> SIGTERM).
3. ''Ctrl+Alt+F1'' or F7 back to the desktop.
4. Hard hang: hold ''Alt+PrtSc'' and slowly type ''R E I S U B'', each letter a beat apart. Safer than holding the power button.

Do Not Bother

See Also