"Out of Memory" or "OOM" killer is a Linux kernel process that runs when the system is critically low on memory. This happens when processes are using a large amount of memory and the system requires memory for its own processes or needs to allocate memory for other processes.

Many processes request more memory from the kernel then they will ever use or need. Because of this the kernel over allocates (overcommits) memory, which allows it satisfy multiple processes requesting more memory then is available, in the knowledge that either they will never use it, or that they will have freed it by the time any other process actually needs it.

However, if enough processes start using all their allocated memory simultaneously there may not be enough physical memory available.

When this situation occurs it is critical and the Linux kernel will invoke the OOM killer to review the running processes and kill one or more of them to free up memory.

Which process will be killed?

The process to kill is a selection that balances the how much memory the process is using with how long the process has been running. Processes that have been running for a long time are less likely to be killed. Subprocesses are summed with parent processes in terms of memory usage, so a process which forks a large number of subprocesses but itself does not use a lot of memory may still be killed.

How to avoid OOM Killer

The OOM killer only runs when the system is critically low on memory, so to avoid it running you need to either reduce your memory usage or increase the available memory by upgrading to a larger plan.

Upgrade to a larger plan

This can be done from the Aiven console or with Aiven CLI client. New nodes with more memory are launched and data from the old nodes are moved to new ones. If you are concerned about downtime you can refer to this article: How much downtime do maintenance operations cause?

Did this answer your question?