Skip to content

Resource limits: CPU, memory, swap and processes

Select an icon to see what it is.

Step 4 of 6

Soft and hard memory, and swap

-m sets memory.max, the hard limit. --memory-reservation sets memory.low, a soft protection the kernel respects when it has to reclaim memory from others. --memory-swap is memory plus swap in total, so runc writes the difference to memory.swap.max.

/sys/fs/cgroup/system.slice/docker-a3b4c5d6e7f80910a3b4c5d6e7f80910a3b4c5d6e7f80910a3b4c5d6e7f80910.scope (systemd cgroup driver)

memory.max 268435456 (-m 256m)
memory.low 134217728 (--memory-reservation 128m)
memory.swap.max 268435456 (512m total minus 256m memory)