Introduction
Sometimes, a container uses too much memory and slows down or crashes your system. Memory limits and reservations help control how much memory a container can use, keeping your system stable and fair for all containers.
When you want to make sure a container never uses more than a certain amount of memory to avoid crashing the host.
When you want to guarantee a minimum amount of memory is always available to a container for smooth operation.
When running multiple containers on one server and you want to prevent one container from using all memory.
When testing how your app behaves under memory pressure by setting strict limits.
When you want to optimize resource use by reserving memory but allowing containers to use more if available.