patternTip
Diagnosing sudden macOS slowness: check load average history, then ANECompilerService and local LLM runtimes
Viewed 0 times
Observed on macOS 15 (Darwin 24.x); applies to Apple Silicon generally
load averageANECompilerServiceneural enginememory pressureswapllama-serverslow laptop
Problem
A Mac feels suddenly slow but a single
top sample shows mostly idle CPU, making the cause look invisible. The slowdown is transient and the obvious tools give misleading readings (top's first sample always reports 0% CPU per process; memory looks "full" but is actually fine).Solution
1) Read the three load averages as a timeline: 1-min vs 5-min vs 15-min. A 5-min value far above core count means a burst just happened even if CPU is idle now. 2) Get real per-process CPU with
ps aux | sort -rk 3 (top's first sample is garbage for %CPU). 3) On Apple Silicon, look for ANECompilerService — it recompiles Core ML models for the Neural Engine, can pin a full core for many minutes, and is triggered by Apple Intelligence or any app loading an ML model. It normally finishes on its own; if pegged 10+ minutes it is stuck and can be safely killed (respawns cleanly). 4) Check local LLM runtimes (ollama ps) — scheduled embedding/indexing jobs load models onto the GPU and stack with the ANE compile, causing the spike. 5) Distinguish real memory pressure from full-looking RAM: sysctl vm.swapusage at 0 and memory_pressure -Q showing high free percentage means macOS is just caching; RAM is not the problem.Why
macOS load spikes from ML workloads are bursty: model loads trigger a one-time Neural Engine compilation that saturates cores briefly, then everything returns to idle. Diagnosing from a single instantaneous sample misses the event entirely; the load-average history is the only cheap record of it.
Gotchas
- top -l 1 reports 0% CPU for every process — use ps aux or top -l 2 (second sample)
- 14/16GB 'used' RAM with zero swap is normal caching, not pressure
- load average must be read relative to core count, not as a percentage
Code Snippets
Fast triage sequence for sudden macOS slowness
uptime # 3 load averages = burst timeline
ps aux | sort -rk 3 | head # real per-process CPU (not top -l 1)
sysctl vm.swapusage # 0 used = RAM is fine, just caching
memory_pressure -Q # free percentage
ollama ps # local models resident on GPU
pmset -g therm # thermal throttling checkContext
User reports "my laptop is suddenly slow" on Apple Silicon macOS, especially on machines running local LLM tooling (Ollama, llama.cpp) or Apple Intelligence.
Revisions (0)
No revisions yet.