在 com.docker.hyperkit 中使用 mac 内存的 docker

我在 MacOS Mojave 上运行 docker 桌面社区2.1.0.3。我给 Docker 分配了8GB 的内存,看起来已经很多了(占了我内存的一半)。不知何故,即使退出并再次启动了 Mac 的 Docker,这意味着没有容器在运行,Docker 已经超出了1GB 的内存分配。

没有运行容器的 Docker 的预期内存使用量是多少?是否有内存泄漏,在多克为 Mac 或多克的超级工具箱?

enter image description here

docker for mac memory leak

55960 次浏览

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

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

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