Memory Mapping (mmap)
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.
What does Memory Mapping (mmap) look like?
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.
Last updated · Fact-checked by The AI Math
Linking to this page from a lesson or article? <a href="https://getaimath.com/dictionary/memory-mapping-mmap/">Memory Mapping (mmap), explained simply</a> (The AI Math Dictionary)