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.

1 Like

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

Source link below:
Stackoverflow: No Cache Option

Thank you very much for your suggestion.
But it doesn’t solve my issue. Also if I use --no-cache option, rebuilding the docker image will take too much time as it took initially. I do not want to go with image creation for each time.

Any help would be grateful.