Check RAM and GPU Use During Local Inference
Capture comparable resource observations before model load, during a local request and after a model unloads.
Difficulty Intermediate
Prerequisites
Use a Linux workstation with Ollama running and one small installed model. A GPU is optional. If you have an NVIDIA GPU and its supported driver, nvidia-smi can provide a separate VRAM reading. Other vendors have different utilities and reporting conventions.
Record a baseline and a run
free -m
ollama ps
Record available system memory and whether Ollama already lists a loaded model. In a second terminal start a short synthetic prompt with your usual local model. While it runs, repeat both readings. On a supported NVIDIA setup run nvidia-smi separately and note per-device memory if available. Use the same model, prompt and options for repeated comparisons.
Interpret the differences
Ollama's processor column can show whether the model uses CPU, GPU or a mixture. Compare memory quantities with the first baseline. Free memory may look low because Linux uses spare memory for caches, so compare the available column. Shared-memory graphics and discrete VRAM behave differently. Report totals and units explicitly.
Troubleshooting and practice
If a model remains listed after a reply, the service can retain it temporarily. Use the documented local stop command for the selected model only if other work is unaffected, then repeat the readings. If the vendor utility is absent, record that GPU memory was unmeasured. Compare shorter and longer prompts and note whether a claimed throughput change coincided with memory pressure. Avoid posting usernames or machine identifiers from diagnostic logs.