A local model in Ollama does not leave memory when the answer ends. The Ollama FAQ says models stay loaded for 5 minutes by default. On an Apple silicon Mac the GPU and your apps share one unified memory pool. So an idle model still holds RAM that Safari, Xcode or Final Cut may want.
This tip starts after setup. If Ollama is not installed yet, see our Ollama on Apple silicon tip first. The commands below run in Terminal while the Ollama menu bar app is open.

Photo: Apple
ollama ps shows what is loaded
Type this in Terminal:
ollama ps
Each loaded model gets one line. NAME and SIZE tell you which model and how much memory it holds. UNTIL is the time left before Ollama unloads it by itself. Empty list, nothing in memory.
On a Mac the PROCESSOR column is the one to read. "100% GPU" means the whole model sits on the GPU side. "100% CPU" means system memory only. A split such as "48%/52% CPU/GPU" means the model did not fit fully on the GPU, and part of the work runs on CPU. Replies get slower in that case. A smaller model or a shorter context helps more than waiting.
ollama stop unloads one model right away
ollama stop llama3.2
Use the name exactly as ollama ps prints it. The model leaves memory at once. Files stay on disk in ~/.ollama/models, so the next ollama run loads it again without a new download. Run ollama ps one more time to check the list is empty.
Apps can do the same per request. The FAQ lists a keep_alive field for the native /api/generate and /api/chat endpoints. It takes a duration like "10m", a number of seconds, 0 to unload right after the reply, or a negative number to keep the model loaded. Example:
curl http://localhost:11434/api/generate -d '{"model": "llama3.2", "keep_alive": 0}'
This is the native API on port 11434. The OpenAI-style base URL in our Ollama OpenAI-compatible API tip is a different path.

Photo: Apple
OLLAMA_KEEP_ALIVE for every model
To change the 5 minute default for all models, set OLLAMA_KEEP_ALIVE. When Ollama runs as the Mac app, the FAQ says server variables go through launchctl, then a restart of the app:
launchctl setenv OLLAMA_KEEP_ALIVE "1m"
Quit Ollama from the menu bar and open it again. A keep_alive sent by an app still wins over this value. A value set with launchctl setenv is gone after a reboot. Run the line again after a restart.
Context length and parallel requests use RAM too
Model size is only part of it. The FAQ lists a default context window of 4096 tokens. A bigger window, set with OLLAMA_CONTEXT_LENGTH or with /set parameter num_ctx inside ollama run, needs more memory. OLLAMA_NUM_PARALLEL is 1 by default, and the FAQ says required RAM scales by OLLAMA_NUM_PARALLEL times OLLAMA_CONTEXT_LENGTH.
OLLAMA_MAX_LOADED_MODELS caps how many models stay in memory together. Set it to 1 with the same launchctl step if you want only one model loaded at a time. A custom model can also carry its own num_ctx line, as in our Ollama Modelfile tip.
To see the effect, open Activity Monitor and pick the Memory tab. Watch Memory Pressure at the bottom while a model is loaded, then again after ollama stop.
Photo: Apple
Source: Ollama FAQ (keep_alive, ollama ps, ollama stop, environment variables on Mac); Apple Newsroom (MacBook Pro with M4, MacBook Pro with M5)