docker for mac memory usage in com.docker.hyperkit

DockerMemory LeaksDocker for-Mac

Docker Problem Overview


I'm running docker desktop community 2.1.0.3 on MacOS Mojave. I've got 8GB of memory allocated to Docker, which already seems like a lot (that's half my RAM). Somehow even after exiting and then starting Docker for Mac again, which means no containers are running, docker is already exceeding the memory allocation by 1GB.

What is expected memory usage for docker with no containers running? Is there a memory leak in docker for mac or docker's hyperkit?

enter image description here

docker for mac memory leak

Docker Solutions


Solution 1 - Docker

As @GabLeRoux has shared in a comment, the "Real Memory" usage is much lower than what you see in the "Memory" column in Activity Monitor.

This document thoroughly explains memory usage on Mac OS with Docker Desktop and information is excerpted from there.

To see the "Real Memory" used by Docker, right-click the column names in Activity Monitor and Select "Real Memory". The value in this column is what's currently physically allocated to com.docker.hyperkit.

enter image description here

Solution 2 - Docker

Alternate answer: I reduced the number of CPUs and Memory Docker is allowed to use within the Docker Resources preferences. My computer is running faster and quieter now.

I just now put this in place, so time will tell if this solution works for me. Before it was making my computer max out on memory. Now it's significantly reduced.

Thank you for the note on real memory. I added that to my Activity Monitor.

UPDATE: It's been a few days now and my computer runs well below the max of memory and my fan runs at a minimum if at all.

Docker resources

Mac memory activity

Mac memory usage

Solution 3 - Docker

I think you shouldn't be using swap while ram is not full, for ssd health and speed

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionwilliamcodesView Question on Stackoverflow
Solution 1 - DockerjbielickView Answer on Stackoverflow
Solution 2 - DockerAdamView Answer on Stackoverflow
Solution 3 - DockerAdrianView Answer on Stackoverflow