Ollama RAM Requirements: 3B, 7B and 14B Measured at 4, 8 and 16GB
What are Ollama’s RAM requirements, and how much RAM does a local LLM need? Put another way: how large a model can you run with 8GB or 16GB? Instead of guessing, I measured it. With Ollama, I ran Qwen2.5 3B, 7B and 14B under RAM caps of 4GB, 8GB and 16GB, three times each: 27 runs, CPU only, no GPU.
Short answer
- 4GB: only 3B runs. 7B and 14B were killed for running out of memory while loading.
- 8GB: 3B and 7B run. 7B peaked at 6.2GiB. 14B was killed.
- 16GB: 14B runs, but it peaked at 13.6GiB, close to the cap.
- Leaving 3–4GB for the OS and browser: an 8GB laptop means 3B, 16GB handles 7B comfortably, and 14B needs 32GB.
Test setup
A 4 vCPU, 16GB Linux server (AWS Lightsail). Each Ollama container had a memory cap with swap disabled (--memory-swap equal to --memory), so “success” means it fit in RAM. Ollama 0.40.4 (image digest 926d40fd6eee…), Ollama’s default quantization for each model (qwen2.5:3b 1.9GB, 7b 4.7GB, 14b 9.0GB), default context of 4096. Each run generated up to 128 tokens for the same English prompt (temperature 0). Peak memory was read from the container cgroup’s memory.peak. This Ollama version loads the model into memory instead of mmapping it on CPU (log: “disabling mmap”), so the number is close to the RAM the model actually held.
| Model (file size) | 4GiB RAM | 8GiB RAM | 16GiB RAM |
|---|---|---|---|
| Qwen2.5 3B (1.9GB) | OK 3/3, peak 3.6GiB | OK 3/3, peak 3.1GiB | OK 3/3, peak 3.8GiB |
| Qwen2.5 7B (4.7GB) | Failed 0/3 (out of memory) | OK 3/3, peak 6.2GiB | OK 3/3, peak 6.3GiB |
| Qwen2.5 14B (9.0GB) | Failed 0/3 | Failed 0/3 | OK 3/3, peak 13.6GiB |
Every failure returned llama-server process has terminated: signal: killed from Ollama, and the cgroup OOM-kill counter went up by one each time.
Speed: how slow is CPU only?
| Model | Tokens/s (range of 3 runs) | First load |
|---|---|---|
| 3B | 5.1–5.7 | 11–16 s |
| 7B | 2.5–2.6 | 17 s |
| 14B | 1.3 | 62 s |
The RAM cap barely changed the speed of a given model. Memory decides whether it runs; the CPU decides how fast. At 1.3 tokens/s, a 100-word answer from 14B takes 1–2 minutes, too slow for chat.
Reading the numbers
- The server CPU is burstable. It runs on CPU credits, so speeds may be lower than its full performance. A recent laptop CPU will be faster. The memory results (runs or not) don’t depend on the CPU.
- A longer context needs more memory. These are at the default 4096 tokens. Raising the context to feed long documents makes the same model use more RAM.
- 3B’s peak varies a little by cap (3.1–3.8GiB), likely because the kernel keeps more cache when there is room. It still finished all three runs under the 4GB cap.
- A GPU changes the picture. These are CPU-only results. Loading the model into GPU VRAM changes both system RAM use and speed.
On my laptop
My laptop is a 2020 Intel 13-inch MacBook Pro with 8GB of RAM. The measurements ran on the Linux server above, not on the Mac. Since 7B peaked at 6.2GiB under the 8GB cap, on this laptop, where macOS and a browser take 3–4GB, 7B would lean on swap. On this machine I start with 3B.
ollama run qwen2.5:3b
If you’re buying or upgrading
- 16GB for comfortable 7B: it ran under an 8GB cap, but with the OS on top, 16GB is the right size.
- 32GB for 14B: it used 13.6GiB under a 16GB cap. To run it alongside the OS you need 32GB.
- Check whether you can upgrade: laptops and mini PCs with RAM slots only need a new module. DDR4 and DDR5 SO-DIMM don’t fit each other’s slots. MacBooks with soldered RAM can’t be upgraded, so decide at purchase.
Reproduce it
The measurement script (measure.sh) and the raw results of all 27 runs (results.tsv and per-setting Ollama logs) are in the public experiment folder. On Linux with Docker, bash measure.sh runs the same sequence. For a single combination, use e.g. MODELS=qwen2.5:7b CAPS=8g bash measure.sh.
All measured RAM numbers in one table: 16GB vs 32GB RAM for programming