Skip to content

Instantly share code, notes, and snippets.

@scaratec
Created April 14, 2016 07:33
Show Gist options
  • Save scaratec/ce39fc849e76afdbea1aeaa9ffa8b3ea to your computer and use it in GitHub Desktop.
Save scaratec/ce39fc849e76afdbea1aeaa9ffa8b3ea to your computer and use it in GitHub Desktop.
Show overall memory consumption of a docker container

Sometimes it is tricky to calculate the required memory for a docker container. To show the current allocated memory (VSZ) run this command from inside the container:

ps --no-headers -o pcpu,vsz | awk '{cpu += $1; vsz += $2} END {print cpu, vsz}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment