Skip to content

Docker stats memory usage is misleading #10824

Description

@SamSaffron
# free -h
             total       used       free     shared    buffers     cached
Mem:          2.0G       1.9G        95M       273M        97M       879M
-/+ buffers/cache:       930M       1.0G
Swap:         1.0G        15M       1.0G
# docker stats app
CONTAINER           CPU %               MEM USAGE/LIMIT       MEM %               NET I/O
app                 51.20%              1.311 GiB/1.955 GiB   67.06%              58.48 MiB/729.5 MiB

so I have 1GB of RAM to play with yet docker stats is reporting 1.3G used on a 2G system, so its reporting pages that are used for disk caching as well as used, which it "technically" used but will be freed by the OS once we run low on RAM

Instead stat should just report (used - buffers cached) and (buffers cached in brackets)

Otherwise people using this information may be mislead as to how bad stuff really is ( http://www.linuxatemyram.com/ )

Also recommend using standard unix postfixes here, so it 1.311G not 1.311 GiB

cc @crosbymichael

Metadata

Metadata

Assignees

No one assigned

    Labels

    exp/intermediatekind/enhancementEnhancements are not bugs or new features but can improve usability or performance.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions