From 38ecdd498fde982d24cf1e61234ecfb7a3aa445a Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 6 Jun 2018 16:55:10 -0500 Subject: [PATCH] Add note about not using free to determine swap availability inside container. --- config/containers/resource_constraints.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/containers/resource_constraints.md b/config/containers/resource_constraints.md index fd84ef3678..2ebb2590f9 100644 --- a/config/containers/resource_constraints.md +++ b/config/containers/resource_constraints.md @@ -118,6 +118,8 @@ Its setting can have complicated effects: - If `--memory-swap` is explicitly set to `-1`, the container is allowed to use unlimited swap, up to the amount available on the host system. +- Inside the container, tools like `free` report the host's available swap, not what's available inside the container. Don't rely on the output of `free` or similar tools to determine whether swap is present. + #### Prevent a container from using swap If `--memory` and `--memory-swap` are set to the same value, this prevents