Error Codes Wiki

Linux errno 12 (ENOMEM) — Out of Memory

Criticalerrno

About Linux errno 12 (ENOMEM)

Linux errno 12 (ENOMEM) means the system or process has run out of available memory. This guide covers everything you need to know about this topic, including common causes, step-by-step solutions, and answers to frequently asked questions.

Here are the key things to understand: ENOMEM — cannot allocate memory. Can trigger the OOM (Out of Memory) killer. Process may be killed by kernel to free memory. Check /proc/meminfo for memory state. Understanding these fundamentals will help you diagnose and resolve this issue more effectively.

The most common reasons this occurs include: Process memory leak consuming all RAM. Insufficient physical RAM for workload. Memory overcommit settings too aggressive. Kernel cannot allocate memory for system operations. Identifying the root cause is the first step toward finding the right solution.

To resolve this, follow these recommended steps: Check memory usage: free -h and top. Identify memory-hungry processes in top/htop. Add swap space: fallocate -l 4G /swapfile. Adjust vm.overcommit_memory in /etc/sysctl.conf. If these steps do not resolve the issue, consider consulting additional resources or a qualified professional.

This article is part of our Linux Error Codes collection on Error Codes Wiki. We provide comprehensive, up-to-date information to help you find solutions quickly.

Quick Answer

What is the OOM killer?

Kernel process that kills memory-hungry processes when the system runs critically low on RAM.

Overview

Linux errno 12 (ENOMEM) means the system or process has run out of available memory.

Key Details

  • ENOMEM — cannot allocate memory
  • Can trigger the OOM (Out of Memory) killer
  • Process may be killed by kernel to free memory
  • Check /proc/meminfo for memory state

Common Causes

  • Process memory leak consuming all RAM
  • Insufficient physical RAM for workload
  • Memory overcommit settings too aggressive
  • Kernel cannot allocate memory for system operations

Steps

  1. 1Check memory usage: free -h and top
  2. 2Identify memory-hungry processes in top/htop
  3. 3Add swap space: fallocate -l 4G /swapfile
  4. 4Adjust vm.overcommit_memory in /etc/sysctl.conf

Tags

linuxerrnoerrno 12 enomemtroubleshootingfix

More in Errno

Frequently Asked Questions

Kernel process that kills memory-hungry processes when the system runs critically low on RAM.