Docker has RAM allocated after killed a process Docker has RAM allocated after killed a process docker docker

Docker has RAM allocated after killed a process


To release memory on the container you can:

  1. Restart the docker container
  2. Clear the host server memory

This is because the Docker container's are represented as processes on the host system. Therefore you would need to free the memory associated with the container process. This can be difficult especially since processes may rely on shared memory structures.

If you want the memory released you can use the following commands to try to clear the host server's memory, If you are using Linux:

Flush data in the memory buffers on disk: $ sync

Clear PageCache only.

sync; echo 1 > /proc/sys/vm/drop_caches

Clear dentries and inodes.

sync; echo 2 > /proc/sys/vm/drop_caches

Clear PageCache, dentries and inodes.

sync; echo 3 > /proc/sys/vm/drop_caches