Docker Desktop using too much memory on Mac? What the VM is holding
Your containers add up to 900 MB, and Activity Monitor says Docker is using 7 GB. Both numbers are honest. The difference is a Linux VM that has filled its RAM with cache and has no reason to give it back.
By Zernonia · December 1, 2026 · 7 min read

On a Mac with Apple Silicon, Docker Desktop doesn’t run containers on macOS. It runs a small Linux virtual machine, and the containers run inside that. With the default setup the VM is started through Apple’s Virtualization framework, so in Activity Monitor it shows up as com.apple.Virtualization.VirtualMachine (recent macOS versions may label it along the lines of “Virtual Machine Service for Docker”), often at 4, 6 or 8 GB.
That number is how much of the VM’s RAM Linux has touched, not how much your containers need. Linux uses spare memory as file cache, the cache stays after builds and test runs finish, and the VM doesn’t promptly hand freed pages back to macOS. So the process grows toward the Memory limit in Docker Desktop › Settings › Resources and stays there.
If it’s hurting (memory pressure yellow or red, swap climbing), the fix is that limit plus Resource Saver. If it isn’t, a large VM process on its own is not a problem. The rest of this post is how to tell which, and what each lever does.
What’s actually inside that number

docker stats sees the containers. Activity Monitor sees the whole VM, cache included.
From the Mac’s side the VM is one process, and its memory is every guest page that has been backed by real RAM. Inside, that splits into roughly four parts:
- Container memory: your Postgres, Node app and Redis. This is what
docker statsshows. - The guest kernel and Docker’s own services: the Linux kernel,
dockerd,containerd, BuildKit. A few hundred MB. - Page cache: every file the guest has read or written recently. Image layers it unpacked,
node_modulesit scanned, database files, build output. Linux keeps all of it in RAM because RAM nobody is using is wasted. On a normal Linux box that’s harmless. In a VM it means the host pays for the guest’s cache. - Memory freed in the guest but still held on the Mac. When a build finishes and its processes exit, Linux marks those pages free. Unless the VM software actively reclaims them, the Mac never finds out, so the pages stay resident in the VM process.
Parts 3 and 4 are why an idle Docker can look as large as a busy one. Run a big image build once and the VM can sit near its limit for the rest of the day.
Swap inside the VM is separate. Docker Desktop’s Swap setting is swap for the Linux guest, stored in the VM’s disk image. It doesn’t show up in sysctl vm.swapusage on the Mac.
Measure it from both sides
Start with the containers:
docker stats --no-stream --format "table {{.Name}}\t{{.MemUsage}}\t{{.CPUPerc}}"
MEM USAGE / LIMIT is per container. The usage figure subtracts the container’s inactive file cache, and the limit is the whole VM’s memory unless you set a per-container limit, so don’t read it as “this container may use 8 GB of my Mac”.
Then look at what Linux in the VM thinks. A container sees the VM’s kernel, so free inside any container reports the whole VM:
docker run --rm alpine free -m
The buff/cache column is the page cache from part 3. A large number there next to a small “used” is the usual picture. Note that free counts a page as free once Linux releases it, while the Mac may still be holding it, so the VM process can be larger than used plus buff/cache.
Then the Mac’s side:
pgrep -fl Virtualization.VirtualMachine
footprint $(pgrep -f Virtualization.VirtualMachine)
footprint reports the same phys_footprint value Activity Monitor uses in its Memory column. Use it, or Activity Monitor, rather than ps RSS, which leaves out compressed pages. If you run more than one VM tool, pgrep returns more than one PID; the com.apple.Virtualization.VirtualMachine page has a way to tell which VM belongs to which app.
Finally, the question that matters: is the Mac short of memory? Check Memory Pressure at the bottom of Activity Monitor’s Memory tab, and swap:
sysctl vm.swapusage
memory_pressure -Q
Green pressure and little swap means the VM is big but not in anyone’s way. The memory pressure guide explains the colours, and the swap guide covers when swap is worth worrying about.
The settings that shrink it
The Memory limit
Settings › Resources (under Advanced in recent versions) has a Memory limit slider. It’s a hard ceiling for the VM: the guest is created with that much RAM, and the process can’t grow past it. Recent versions default to up to half of your Mac’s memory, which is generous for most projects on a 16 GB Mac.
To pick a value, run your normal stack, check docker stats, and leave a gigabyte or two above the total for the engine, builds and some cache. Click Apply & restart; the VM restarts, so running containers stop. If containers start getting killed with exit code 137 (out of memory), you went too low.
A lower limit doesn’t make Linux cache less eagerly; it just gives it less room. That’s the point. Cache in a 4 GB VM costs at most 4 GB.
Resource Saver
Resource Saver stops the VM when no containers have run for a while, and starts it again on the next docker command. When the VM is stopped, its memory goes back to macOS, cache and all. It’s on by default in recent Docker Desktop versions and lives in Settings › Resources too, with a configurable idle timeout. Where exactly it sits, and the default timeout, have moved between versions, so search Settings for “Resource Saver” if it isn’t where you expect.
This is the main way Docker Desktop gives memory back. If you leave Docker running all day with nothing in it, check this is on.
Stopping things
Stopping containers frees their memory inside the VM but doesn’t necessarily shrink the process on the Mac, for the reasons above. To get memory back right now, stop the VM: quit Docker Desktop from its menu bar icon, or let Resource Saver do it. Don’t force-quit the VM process. That’s pulling the plug on every running container.
A note on the VM backend
In Settings › General, recent Docker Desktop versions let you choose the virtual machine manager: Apple Virtualization framework, Docker’s own Docker VMM (on Apple Silicon, in newer releases), or the legacy QEMU option. Everything above applies to all of them, but the process name changes. With Docker VMM the VM doesn’t run inside Apple’s Virtualization process, so look for it under Docker’s own process names instead.
It’s not only memory: disk
The page cache is in RAM, but the images and volumes behind it live in Docker’s disk image on your Mac, which grows and doesn’t shrink on its own. See what’s there:
docker system df
docker system prune removes stopped containers, unused networks, dangling images and build cache; add -a to remove every image no container uses, and --volumes only if you’re sure no volume holds data you want. Smaller images also mean less for the guest to cache. The developer disk space guide has the rest, including where Docker’s disk image lives.
Other VM tools show up the same way
Docker Desktop isn’t the only thing that runs com.apple.Virtualization.VirtualMachine. Anything built on Apple’s Virtualization framework does:
| Tool | Where its memory is set | Notes |
|---|---|---|
| Docker Desktop | Settings › Resources | Resource Saver stops the idle VM |
| OrbStack | Its Settings (memory limit) | Advertises returning unused memory to macOS dynamically |
| Colima | colima start --memory 4 (GiB) | Uses Apple’s framework with --vm-type vz; colima stop frees it all |
| Lima | memory: in the instance’s lima.yaml | Same framework with vmType: vz |
| UTM | Edit the VM › System › Memory | Only in Apple Virtualization mode; QEMU mode runs as QEMU processes |
OrbStack and Colima are the common alternatives to Docker Desktop on a Mac, and the docker CLI works with both. I use Colima on this Mac (its default profile here is set to 4 CPUs, 8 GiB and vmType: vz), and the same rules hold: the VM is as big as its limit lets Linux make it. Which tool suits you depends on licensing, features and taste more than memory, but if the VM’s footprint is your main complaint, a tool that reclaims guest memory, or a lower limit in the one you have, both help.
Two VM tools running at once means two VM processes, each with its own cache. That’s an easy way to lose 10 GB on a 16 GB Mac without noticing.
What I watch for
The question I actually care about isn’t “how big is the VM” but “is it why my Mac is slow”. So I watch memory pressure and swap, not the process size. A VM at its 6 GB limit with green pressure is fine. Swap climbing every time a build runs means the limit is too high for the RAM I have, or something else needs closing.
Stat Space shows both in the menu bar and keeps per-minute history of pressure and swap for 30 days, so I can see whether they climb when a Docker build runs. Its Apps tab groups the VM process and com.docker.backend under Docker as one row. With Pro, the Ports tab also replaces com.docker.backend with the container name and image behind each published port, for Docker and OrbStack. Stat Space is a lean menu bar system monitor for Apple Silicon, free with a one-time Pro upgrade, at statspace.app.
Also on DEV, if you'd like to follow or comment there.
Questions
Why does com.apple.Virtualization.VirtualMachine use so much memory with Docker?
That process is Docker Desktop's Linux VM. Its memory is every page of guest RAM Linux has touched, including file cache and memory containers have already freed, up to the limit in Settings › Resources.
How do I limit Docker Desktop's memory on Mac?
Open Docker Desktop's Settings › Resources, lower the Memory limit, and click Apply & restart. The VM can never grow past that limit, whatever the containers do.
Why is Docker using memory with no containers running?
The VM keeps the memory Linux has already used for cache until it stops. Resource Saver stops the VM after a few idle minutes; quitting Docker Desktop stops it immediately.
Does docker stats show the real memory use?
It shows each container's memory inside the VM, minus some of its file cache. It doesn't include the VM's kernel, the Docker engine, or cache outside containers, so the total is always lower than the VM process on your Mac.
Know what your Mac is doing, without adding to it.
Free, no account. Pro is $9.99 once, and only 30 launch-price licenses are left before it goes to $14.99.