JC
2016-03-03 06:18:06 UTC
Hello experts,
I'm digging through the code and I see that in order to get memory
percentage, this is the code that is doing the calculation:
https://github.com/docker/docker/blob/131e2bf12b2e1b3ee31b628a501f96bbb901f479/api/client/stats.go#L68
It's pretty self-explanatory. Usage/Limit. However, if I follow the limit
variable, I end up tracing it down to the fact that it is grabbing the data
from /sys/fs/cgroup/memory/memory.limit_in_bytes. However, if you don't
set the memory when starting the container, that value becomes the maximum
number, which in my case is 9223372036854771712 (2^64 ish).
Where does in the code does it show where it finds the memory limit if you
don't define the limit_in_bytes when starting a container? Thanks!
I'm digging through the code and I see that in order to get memory
percentage, this is the code that is doing the calculation:
https://github.com/docker/docker/blob/131e2bf12b2e1b3ee31b628a501f96bbb901f479/api/client/stats.go#L68
It's pretty self-explanatory. Usage/Limit. However, if I follow the limit
variable, I end up tracing it down to the fact that it is grabbing the data
from /sys/fs/cgroup/memory/memory.limit_in_bytes. However, if you don't
set the memory when starting the container, that value becomes the maximum
number, which in my case is 9223372036854771712 (2^64 ish).
Where does in the code does it show where it finds the memory limit if you
don't define the limit_in_bytes when starting a container? Thanks!