Docker Memory Constraints

Don’t use free to measure container memory usage #

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.1

Instead use docker stats <CONTAINER ID>2.


  1. More info: docker --memory-swap docs ↩︎

  2. See: docker stats docs ↩︎


July 17, 2020
categories: docker
tags: docker, memory, swap, profiling