What does errno 12 (ENOMEM) mean?

 
Could be also:
ConstantTypeOS
ERROR_INVALID_ACCESSWin32 errorWindows
KERN_NOT_IN_SETKern returnMac
ippStsOverflowIntel Ipp StatusAny
MAXIMUM_WAIT_OBJECTS_EXCEEDEDBugCheck CodeWindows
Previous Next
ECHILD EACCES

ENOMEM

Why it is not always a simple RAM shortage

ENOMEM signals that the operation could not obtain needed memory or kernel resources. The failing resource may be user-address space, kernel allocation, a pipe buffer, descriptor-related state, or another object required by the particular API. A machine can still appear to have free memory while a per-process limit, container limit, address-space layout constraint, or kernel allocation condition prevents the specific request.

For process execution, the error can arise while the kernel prepares a new program image. For file and IPC operations, it can appear while allocating internal buffers or metadata. The correct interpretation therefore begins with the exact syscall and its arguments, not with a generic “add more RAM” response.

How to investigate

  • Record the operation, allocation size or object count, and current process/resource limits.
  • Check memory pressure, container/cgroup limits, address-space limits, and kernel logs together.
  • Look for unbounded queues, descriptor leaks, excessive inherited environment data, or unexpectedly large buffers.
  • Fail safely: preserve the original error, release recoverable work, and avoid looping allocations without backoff.

References


Looking for a different code? Search another status or error code.