Why is Docker Swarm Consuming All Available RAM?

Why is Docker Swarm Consuming All Available RAM?

A few weeks ago we were alerted that Docker Swarm was using over 8GB of RAM. Our investigation led us to discover an unexpected factor that determines its memory usage. After a bit of graphing and math, we were able to locate the code behind this unexpected behavior.

Docker Swarm manages multiple Docker hosts in a way that makes it look like you are running on a single Docker host. Swarm takes container create requests and finds the best host to run it on. Swarm abstracts hosts away so you don’t need to know what host a container is running on to perform an action on them (such as stop, start, inspect, or exec).

[…]