Install earlyoom by entering the following commands in the terminal:
sudo apt update sudo apt install earlyoom
Description:
Early OOM Daemon
Earlyoom is an userspace OOM-killer which can avoid the system to get into unresponsive state caused by swapping, which is most likely to occur when a large swap is present and memory is tight. It checks the amount of available memory and swap periodically, and when both are below a preconfigured value, it kills the largest process.
Homepage: https://github.com/rfjakob/earlyoom
Version: 1.0-1
Section: universe/admin