Skip to content

17. Lima start and stop

17. Lima start and stop

After #16, per-container VMs are out on macOS, and the candidate is one Lima VM running containerd and gVisor, the Linux backend unchanged. The spec rejected that partly because a VM that is always running holds memory. Gavin: memory is the point of allmyram, so the VM must hold memory only while there is work. It has to start and stop quickly.

Predictions

Written before running. Lima 2.3.0 (Homebrew), vmType: vz, Debian 13 arm64, 4 CPUs, 8 GiB, plain mode.

Measure Expected
First create and provision minutes (image download, apt)
limactl start of a stopped VM, until it returns under 10 s
…until a gVisor pod (runsc, alpine true) has run, image cached under 15 s
limactl stop under 5 s
Host memory once stopped none: the VM's process is gone
Host footprint, running and idle 300–600 MB (guest kernel, systemd, containerd)
Host footprint during a 2 GiB job, and 60 s after it ends grows by ~2 GiB, and doesn't shrink back while the VM runs
A job's image pulled fresh vs cached pull dominates the first job

Setup (2026-11-23)

  • Gavin's MacBook as in #9–#16. Lima 2.3.0 from Homebrew. (Rancher Desktop on the same Mac bundles a Lima 2.3.0-beta.1-176-g25ca6205 with its own VM, left alone.)
  • spike/lima_allmyram.yaml: Debian 13, containerd from Debian, gVisor release-20261116.0 aarch64 (gvisor.tar.zstd, sha512 checked), crictl v1.37.0, the CRI handlers and CNI bridge of spike/install_cri.sh.
  • spike/lima_start_stop.py --cycles 5: stop, start, then a gVisor pod (alpine true, image cached) through crictl run --runtime runsc; then the VM process's footprint idle, during a 2 GiB job and after it; then a fresh and a cached pull of the uv image Plan 1's acceptance used.

Raw results

  • First limactl create: 24 s (Debian cloud image download). First limactl start including provisioning: 46 s.
Cycle limactl stop (s) limactl start (s) start → gVisor pod exited (s)
0 3.57 6.77 9.87
1 2.56 5.63 6.83
2 2.06 5.97 7.07
3 2.05 5.66 6.75
4 1.56 4.58 5.76

After every stop, no com.apple.Virtualization.VirtualMachine process was left: a stopped VM holds no memory on the Mac.

VM running Host footprint
Idle after start 791 MB
During a job holding 2 GiB 2865 MB
Job ended, pod removed 2865 MB
60 s after the job 2865 MB
Pull of ghcr.io/astral-sh/uv:0.12.0-python3.14-trixie-slim Seconds
Fresh 3.79
Cached 0.45