Linux Labs

Inside the system: resources, kernel, processes / Stage 2 of 12

Memory, swap and the OOM killer

Not running Starting usually ~20 s
Leave the lesson

Step 9 of 9 · summary · 2 min

Summary

  • In free -h, free is memory used for nothing; available is how much can be given to processes, counting the cache the kernel will drop.
  • Reading files grows buff/cache and barely changes available.
  • Without swap, process data lives only in RAM; when it runs out, the OOM killer ends a process with SIGKILL.
  • MemoryMax= is a service's memory ceiling: when the service hits it, journalctl -k has a Memory cgroup out of memory line, and the service gets Result=oom-kill.
  • Your own unit settings go into a drop-in in /etc/systemd/system/<unit>.d/ plus systemctl daemon-reload.
  • The preview service from the start of the lesson restarted in a loop: the panorama and its copy did not fit into its 64 MiB ceiling, although the machine had about 300 MiB available.
Ubuntu 24.04
Loading…