While running a Python service in Kubernetes (pod with just one container, my Gunicorn process has PID 1
), I monitor the memory usage:
psutil.Process().memory_full_info()
output:
pfullmem(rss=669609984, vms=5986619392, shared=229244928, text=4096, lib=0, data=3318370304, dirty=0, uss=658903040, pss=664651776, swap=0)
However, cgroups
(which Kubernetes uses to decide when to OOM-kill a pod)
cat /sys/fs/cgroup/memory.current
shows (at the same time):
474193920
So it does not correspond to any of the values shown by psutil
.
Where the difference comes from?