From ab42b091eec0f193e30e3fac872ec6f4b5037be2 Mon Sep 17 00:00:00 2001 From: Sean Christopherson Date: Tue, 10 May 2016 09:58:55 -0700 Subject: [PATCH] Add the swapMemorySupport requirement to OOM tests Add the swapMemorySupport requirement to all tests related to the OOM killer. The --memory option has the subtle side effect of defaulting --memory-swap to double the value of --memory. The OOM killer doesn't kick in until the container exhausts memory+swap, and so without the memory swap cgroup the tests will timeout due to swap being effectively unlimited. Document the default behavior of --memory-swap in the docker run man page. Signed-off-by: Sean Christopherson --- man/docker-run.1.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/man/docker-run.1.md b/man/docker-run.1.md index 8fb856b5dc..101acfa606 100644 --- a/man/docker-run.1.md +++ b/man/docker-run.1.md @@ -353,7 +353,8 @@ as memory limit. **--memory-swap**="LIMIT" A limit value equal to memory plus swap. Must be used with the **-m** (**--memory**) flag. The swap `LIMIT` should always be larger than **-m** -(**--memory**) value. +(**--memory**) value. By default, the swap `LIMIT` will be set to double +the value of --memory. The format of `LIMIT` is `[]`. Unit can be `b` (bytes), `k` (kilobytes), `m` (megabytes), or `g` (gigabytes). If you don't specify a