Why is Openshift reporting a far greater container memory usage than the same Docker container running locally? Why is Openshift reporting a far greater container memory usage than the same Docker container running locally? kubernetes kubernetes

Why is Openshift reporting a far greater container memory usage than the same Docker container running locally?


I finally found the reason of this difference in these two references:

https://github.com/openshift/origin-web-console/issues/1315

https://access.redhat.com/solutions/3639191

Summing up: Docker reports memory as the addition of several elements such as rss and cache:

https://docs.docker.com/config/containers/runmetrics/#metrics-from-cgroups-memory-cpu-block-io

cache The amount of memory used by the processes of this control group that can be associated precisely with a block on a block device. When you read from and write to files on disk, this amount increases. This is the case if you use “conventional” I/O (open, read, write syscalls) as well as mapped files (with mmap). It also accounts for the memory used by tmpfs mounts, though the reasons are unclear.

rss The amount of memory that doesn’t correspond to anything on disk: stacks, heaps, and anonymous memory maps.

Openshift 3.x reads that information using Heapster and can`t tell appart both types of memory.

If you check the docker stats of the container that is running inside Openshift you will find the expected (lower) value.