Learn AI Math

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?

Like this explanation? Get one every week.

The AI Math newsletter turns confusing AI news into plain English. No hype, no jargon walls.