So, I was comparing some memory metrics in some pods, and it seems that the reported memory usage seen in Kubernetes Dashboard is different from the output of a top
command (RES column) from inside the pod/container.
Here it is an example Dashboard screenshot (774 Mib):
and the output of top
command inside container:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 elastic+ 20 0 3770364 1.120g 828 S 0.0 15.3 962:37.36 java
For completion, the output of free -h
in that container:
total used free shared buffers cached
Mem: 7.3G 6.7G 591M 151M 107M 660M
-/+ buffers/cache: 6.0G 1.3G
Swap: 0B 0B 0B
Another example:
with top
output:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 elastic+ 20 0 3859032 517640 25120 S 1.0 6.7 3:22.52 java
In this case the used memory is much less than the reported one.
The Kubernetes version is 1.4.