Closed
Description
# 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
Activity
crosbymichael commentedon Feb 23, 2015
+1 I think it would make sense to make this change.
blackfader commentedon Feb 26, 2015
yes memory is not right
mattva01 commentedon Mar 22, 2015
@spf13
This is a little harder then it seems, as it requires modifying libcontainer code here: https://github.com/docker/libcontainer/blob/master/cgroups/fs/memory.go
Do we use memory.stat.rss, memory.stat.usage_in_bytes - memory.stat.cache, or some other combination of stats...?
jessfraz commentedon Mar 22, 2015
I switched to the proficient label
On Sunday, March 22, 2015, Matthew Gallagher notifications@github.com
wrote:
imleon commentedon Mar 23, 2015
Try set the param of docker run --memory,then check your
/sys/fs/cgroup/memory/docker/<container_id>/memory.usage_in_bytes
It should be right.
69 remaining items