﻿# llama.cpp graph metadata: reserved capacity and resident pages are different budgets

The b12322 metadata change avoids touching unused host pages; report resident-memory metrics instead of treating reserved capacity as live tensor data.

Author: Retrivium team
Updated: 2026-11-15
Canonical URL: https://retrivium.ai/journal/week46-engine-graph-metadata-untouched-pages/
Language: en

llama.cpp b12322 avoids initializing unused graph-metadata pages. The release explanation notes that reserving for maximum node capacity and touching the whole buffer can make pages resident even when a graph uses only a fraction. This is host metadata memory, separate from model-weight precision and KV-cache storage.

## Maximum graph size is not actual graph use

The runtime needs enough metadata capacity for an upper bound on nodes. That does not imply that every graph populates the entire reserve. The release changes the allocation approach so unused capacity is not initialized wholesale. This targets pages touched by metadata construction, rather than compressing the graph’s mathematical tensors. Describing the change as a reduction in model size would therefore misidentify the memory category involved.

## Choose the memory counter deliberately

Virtual reservation, committed storage, resident pages and a platform’s working-set measure do not answer exactly the same question. A patch that avoids touching pages may be visible in one counter while leaving nominal capacity unchanged. A proposed comparison should name the operating-system metric, sample the relevant lifecycle and preserve the graph settings. Without that information, two apparently conflicting memory reports can simply be measuring different things.

## Keep neighbouring patches out of the attribution

The upstream PR distinguishes its result on the ordinary baseline from a result combined with another arena-related change. That is important causal bookkeeping. If a local branch includes both changes, report it as a combined configuration rather than assigning all savings to b12322’s metadata initialization. A clean before-and-after comparison should keep unrelated allocator and scheduler changes fixed, or explicitly document why the comparison contains them.

## Validate use, not just allocation

Avoiding initialization is safe only if later code writes the metadata it actually consumes. Numerical and graph-construction regression coverage remain relevant even when the primary goal is memory reduction. An empty startup check does not exercise the used part of the reserve. This article reports the published design and proposes measurement boundaries; it does not claim that the upstream memory savings repeat unchanged on another model or operating system.

## Sources

- [llama.cpp b12322 release](https://github.com/ggml-org/llama.cpp/releases/tag/b12322)
- [llama.cpp pull request #32043](https://github.com/ggml-org/llama.cpp/pull/32043)

## Related reading

- [CUDA OOM Allocated vs Reserved: Read the Evidence](/journal/cuda-oom-reserved-vs-allocated/)
- [llama.cpp MTP and a GTT spike: runtime memory beyond successful loading](/journal/llama-cpp-mtp-context-gtt-runtime-memory-author-correction/)
