Memory discrepancy between Kubernetes Dashboard and actual usage

3/27/2017

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):

enter image description here

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:

enter image description here

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.

-- David Fernandez
docker
kubernetes

0 Answers