I have a Rocket web application packed into a Docker image. The application uses 4 or 5 times of more memory on start when deployed and running inside our Kubernetes environment (some Linux Docker host), than the memory usage of it running as a container on a Mac laptop Docker host.
What could cause this memory difference?
Locally (as a container running in my Mac laptop docker):
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 20 0 187944 18916 12308 S 0.0 0.9 0:00.12 backend
25 root 20 0 41024 3116 2668 R 0.0 0.2 0:00.03 top
On Linux docker host (Or on kubernetes):
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 20 0 239244 108408 10840 S 0.0 0.3 0:00.67 backend
38 root 20 0 18144 3260 2820 S 0.0 0.0 0:00.00 bash
44 root 20 0 41032 3124 2660 R 0.0 0.0 0:00.00 top
You can see the RES
value of the process backend
is much higher as running on Kubernetes
I have double checked that the image versions are exactly the same.