To free the memory a local model is using, run ollama stop with the model name. Ollama’s FAQ says models are kept in memory for five minutes by default after their last use, and that ollama stop unloads a model immediately. Closing the chat window does not unload it; the stop command does.
How long a model stays loaded
Ollama’s FAQ states the rule plainly: models are kept in memory for five minutes by default, ollama stop unloads a model immediately, and the keep_alive parameter controls how long a model stays loaded. The README’s CLI reference gives the command:
ollama stop llama3.2
To see what is loaded before and after, the README gives ollama ps, which lists which models are currently loaded.
Try it: load, check, stop, check again
Run a small model, then check what is loaded, stop it, and check again. Use a practice model name from your own list, such as llama3.2 in the examples below.
| Step | Command | What you should see |
|---|---|---|
| 1. Run | ollama run llama3.2 |
A chat starts |
| 2. Check loaded | ollama ps |
llama3.2 is listed as loaded |
| 3. Stop | ollama stop llama3.2 |
The command finishes |
| 4. Check again | ollama ps |
llama3.2 is no longer listed |
Expected result. We checked the Ollama FAQ and README. We did not run ollama stop on this machine.
Limits
Stopping a model frees the memory that model was using, but it does not delete the model from disk — the download stays, and running it again loads it back. The five-minute default is a default, not a promise: the keep_alive parameter can change it, so a model you set to stay loaded will not follow the five-minute rule. We did not measure memory use on any machine, so this check answers whether the model is loaded, not how many megabytes were freed.
