Is Docker Desktop using all of your MacBook's memory?

Is Docker Desktop using all of your MacBook's memory?

Did your MacBook slow down after you started using Docker?

I worked with a talented junior engineer once who had struggled with poor performance on his MacBook Air. He did not see anything obviously wrong that he was doing, but he also did not have a ton of systems administration-type experience like I do.

So he and I sat down together on a video call, he showed me his screen, and we looked through what his machine was doing. We quickly found that Docker was using up half the memory on the machine, even though my colleague wasn’t running any Docker containers.

I have used Docker on Linux for years, and I was quite surprised when I found that Docker Desktop for Mac allocates 4GB of memory - half the memory of his MacBook! - to a VM for running Docker containers on Mac. His MacBook was running out of memory and putting things into swap, which is considerably slower than memory.

What can you do to reduce Docker Desktop’s memory usage?

There is unfortunately no way around that limit at this time in Docker Desktop for Mac; however, there are other solutions for running Docker on Mac. My colleague had a great experience using OrbStack, for example, which does not require setting aside a fixed amount of memory to run Docker containers. Another one of our colleagues actually had used OrbStack for some time and was satisfied with its performance.

Once he stopped using Docker Desktop for Mac he stopped having performance issues. His MacBook no longer ran out of memory even though he was not doing anything particulary resource intensive.