# Memory Mapping (mmap)

- **Canonical URL:** https://getaimath.com/dictionary/memory-mapping-mmap/
- **Topics:** [AI Infrastructure & Runtime](https://getaimath.com/dictionary/category/ai-infrastructure-and-runtime/)
- **Last updated:** 2026-11-25

## What is Memory Mapping (mmap)?

**In one sentence:** Memory mapping, or mmap, lets a program treat a file on disk as if it were already in memory, loading pieces only when needed.

Instead of reading the whole model file at the start, the operating system brings in parts as they are used. This makes models open faster and lets several programs share the same loaded file.

![AI Runtime Engines: Sharing the Oven So Nobody Waits in Line — Simple cartoon showing 4 users ordering at a coffee counter: instead of making everyone wait behind one huge order, a smart Runtime Engine serves all 4 side-by-side at the same time.](https://getaimath.com/diagrams/ai-infrastructure-and-runtime.png)
*Napkin Diagram (AI Infrastructure & Runtime): A runtime engine is the traffic controller that lets one AI chip serve dozens of people at once without anyone getting stuck.*

## What is an example of Memory Mapping (mmap)?

llama.cpp uses mmap so a large GGUF model starts almost instantly.

## Why does Memory Mapping (mmap) matter?

It saves memory and speeds up model loading.

## Related Concepts

- [GPU Offloading](https://getaimath.com/dictionary/gpu-offloading/): GPU offloading moves work from the CPU to the GPU to make it faster.
- [Model Loading](https://getaimath.com/dictionary/model-loading/): Model loading is the step of reading a model's weights from storage into memory so it can run.
- [CPU Offloading](https://getaimath.com/dictionary/cpu-offloading/): CPU offloading moves some model layers or data from the GPU to the CPU and system RAM.
- [Cold Start](https://getaimath.com/dictionary/cold-start/): A cold start is the delay when a model or server has to start from scratch before it can answer a request.
- [Model Offloading](https://getaimath.com/dictionary/model-offloading/): Model offloading moves parts of a model out of fast GPU memory into slower memory, like system RAM or disk, so it can still run.
- [Warm Start](https://getaimath.com/dictionary/warm-start/): A warm start is when a model is already loaded and ready, so requests are answered right away.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/memory-mapping-mmap/)
