Keeping a machine with 4-8 GB of soldered RAM responsive: the goal is never hitting the disk-thrash-frozen-UI cliff.
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”).
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.
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.
about:config → accessibility.force_disabled = true stops Firefox burning a few hundred MB on features nothing uses.browser.tabs.unloadOnLowMemory = true (already default on Linux).extensions.pocket.enabled = false.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.
available is what counts.