Docker memory limit

There are some options to control application memory consumption.

Docker has a couple of flags to control application inside the container.

  1. –memory flag defines non swap memory limit
  2. –memory-swap flag defines total memory limit (swap + non swap memory) Details can be found here

Moreover, there is a cgroups limit at the os level. To check it

    cat /sys/fs/cgroup/memory/memory.limit_in_bytes

When you try to check is, in some situations you can see some huge magic number

cat /sys/fs/cgroup/memory/memory.limit_in_bytes

This is a maximum 64-bit signed integer rounded to the nearest page Source