Docker Community Forums

Share and learn in the Docker community.

Is there any mechanism in docker to release docker memory cache?



I have a nodejs application to run an emulator in docker container and found that memory usage is high when the docker container is running and my PC gets hang or job is failing.
If I release the cache manually using the below command,
sync; echo 3 > /proc/sys/vm/drop_caches
I could run the job successfully.

Is there any mechanism in docker to control memory usage or release docker memory cache
(I want to keep docker image) or dropping memory cache automatically?

Note: I do not want to remove docker image.

Thanks in advance.


Not sure about “releasing”, but there is a --no-cache option.

Source link below:
Stackoverflow: No Cache Option