Skip to content

ReferenceThe 22 checks

Out-of-memory kills

Health checkoom

What it reads

The kernel log for the last 24 hours, through journalctl or /var/log/kern.log.

Does it need root?

It needs root for part of what it reads. On Ubuntu the kernel log can be read only by root and the adm group. Without root, that part is skipped and never counted as passed. Run sudo kiyesi scan to include it.

When it passes

The report lists it as passed, in these words:

  • No process was killed for memory in the last 24 hours

What it can find

Critical

The process process was killed for using too much memory at time

This server has total of memory and no swap, so one spike takes the app down.

Fix
sudo fallocate -l 1G /swapfile && sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile && echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
Critical

The process process was killed for using too much memory at time

When memory runs out, Linux kills the biggest process, and everyone using it gets errors. Set a memory limit on the container that grows, or move to a server with more memory.

Fix
ps -eo pid,comm,rss --sort=-rss | head -n 6

When it is skipped

A skipped check never counts as passed. The report says why, in one of these sentences:

  • found no kernel log: neither journald nor /var/log/kern.log is on this system