mincore MINCORE_PAGED_OUT probe for compressor residency of Metal buffers
Parent: Mac local LLMs: Memory and wired limits · Published reference · snapshot 2026-10-05
↓ Facts as markdownall context files
A page is reported either present (INCORE) or, only if absent, queried in the compressor pager; the code breaks out of the loop as soon as `vm_page_lookup` returns a page, so INCORE and PAGED_OUT never both appear for one page.
These notes link each claim to its source. A source may be a research report hosted on this site rather than the primary document. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
Facts
- A page is reported either present (INCORE) or, only if absent, queried in the compressor pager; the code breaks out of the loop as soon as `vm_page_lookup` returns a page, so INCORE and PAGED_OUT never both appear for one page. [source]
- The compressor query runs only for internal objects that are alive, not terminating and pager-ready, so file-backed pages never report PAGED_OUT. [source]
- Measured: for a 4 GiB anonymous region written with memset on a pressured 64 GB host, one run reported 204,200 INCORE and 57,944 PAGED_OUT, a total of 262,144 pages (all of them). Five sweeps gave 188 k to 204 k INCORE and 58 k to 74 k PAGED_OUT, so about 22 to 28 percent of freshly written pages were already in the compressor. [asserted] (measured locally 2026-10-04, Apple M5 Max 64 GB, macOS 27.2) [source]
- Measured: `mincore` over the `contents` pointer of a 2 GiB `MTLResourceStorageModeShared` buffer reported 0 INCORE before the CPU touched it, all 131,072 pages INCORE after memset, and ANONYMOUS set for every page; PAGED_OUT was 0 because nothing had been compressed yet. [asserted] (same host) [source]
- Measured: a cached 4 GiB file-backed mapping reported all pages INCORE and 0 PAGED_OUT. [asserted] (same host) [source]
- The probe reads the pager state only; it does not decompress, so it does not itself bring pages back. [source]
- Not documented in sources read. [source]
- The Metal buffer test could not show a nonzero PAGED_OUT for a Metal buffer because the host was not under pressure at that moment; the anonymous-region run shows the probe sees compressor state on this OS, and the `contents` pointer of a shared MTLBuffer is anonymous memory by the ANONYMOUS flag. Inference: the same probe will count compressed pages of such buffers once they are compressed. [source]
- A GPU-only private buffer has no CPU pointer, so the probe cannot be used on it. [source]
- Counts are a snapshot; pages can be compressed or decompressed between the call and the next GPU kernel. [source]
- A buffer's compressor share can be non-trivial even while `kern.memorystatus_vm_pressure_level` is Normal (see the 22 to 28 percent above), so Normal pressure does not mean fully resident. [source]
- None found. [source]
- A run on a live MLX or llama.cpp process after a long idle period, with vm_stat decompress counts, is still unpublished. [source]
- Whether wired shared buffers can ever report PAGED_OUT (a wired page should not be compressed). [source]
- INCORE and PAGED_OUT are mutually exclusive per page. [source]
- PAGED_OUT can only appear for internal (anonymous) objects. [source]
- On an M5 Max under mild pressure 22 to 28 percent of a freshly written 4 GiB anonymous region was already compressed when probed. [source]
- The contents pointer of a shared MTLBuffer reports ANONYMOUS and fills INCORE as the CPU touches pages. [source]
- A sweep costs about 20 ms per GiB (see cost-of-a-mincore-sweep-per-gb-on-apple-silicon.md). [source]
Children
- No children recorded.