AWS DevOps Engineer Professional DOP-C01 – Question486

What flag would you use to limit a Docker container's memory usage to 128 megabytes?

A.
-memory 128m
B. -m 128m
C. –memory-reservation 128m
D. -m 128MB

Correct Answer: B

Explanation:

Explanation:
Docker can enforce hard memory limits, which allow the container to use no more than a given amount of user or system memory, or soft limits, which allow the container to use as much memory as it needs unless certain conditions are met, such as when the kernel detects low memory or contention on the host machine.
Some of these options have different effects when used alone or when more than one option is set. Most of these options take a positive integer, followed by a suffix of b, k, m, g, to indicate bytes, kilobytes, megabytes, or gigabytes.
Option -m or –memory=
Description The maximum amount of memory the container can use. If you set this option, the minimum allowed value is 4m (4 megabyte).
Reference:
https://docs.docker.com/engine/admin/resource_constraints/#memory