Metal newBufferWithBytesNoCopy file-cache-backed weights refault
Parent: Mac local LLMs: Memory and wired limits · Published reference · snapshot 2026-10-05
↓ Facts as markdownall context files
Apple documents makeBuffer(bytesNoCopy:length:options:deallocator:) as wrapping an existing contiguous allocation, requiring a page-aligned pointer and a length that results in a page-aligned region, and returning nil on failure.
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
- Apple documents makeBuffer(bytesNoCopy:length:options:deallocator:) as wrapping an existing contiguous allocation, requiring a page-aligned pointer and a length that results in a page-aligned region, and returning nil on failure. [source]
- The deallocator block runs when the buffer is deallocated so the caller can release the underlying memory, or nil opts out. [source]
- MLX's own allocator wraps external memory through make_buffer with device newBuffer(ptr, size, options, nullptr), a nil deallocator, shared storage mode, and adds the buffer to the residency set. [source]
- A residency-set entry for a NoCopy buffer asks the OS to keep the pages resident, but a read-only file-backed mapping can still be evicted before first use; the existing dossiers cover the refault evidence. [source]
Children
- No children recorded.