memory limit

The most memory a container may use before the kernel kills a process inside it.

In more detail

Set it with --memory (short form -m), for example -m 64m for 64 megabytes. The value lands in the memory.max control group file, in bytes. When the container goes over it, the OOM killer ends a process inside that container, and the container typically exits with code 137.

Example

docker run --rm -m 64m alpine:3.20 cat /sys/fs/cgroup/memory.max

Related terms

Taught in

References

Certification courses