Memory mapping#

scikitplot.memmap exposes a small native memory-mapping API for anonymous or file-backed regions. It is intended for explicit lifetime management and random byte access, not for parsing file formats or replacing ordinary stream I/O.

Important

A memory mapping is a resource with operating-system lifetime and protection rules. Prefer a context manager, validate offsets and sizes, and never treat a raw address as a portable data interface.

Getting started

Create an anonymous or file-backed mapping and close it deterministically.

Getting started
Lifecycle and I/O

Read/write mapped ranges, context management, offsets, and ownership.

Lifecycle and I/O
Protection, sync, and locking

Use mprotect, msync, and mlock with platform-aware expectations.

Protection, sync, and locking
Python API

MemoryMap, mmap_region, flags, validation helpers, and exceptions.

Python API
Platform and limits

Page alignment, permissions, native-build requirements, and portability.

Platform and limits

Which page should I use?#

Start with Getting started. Then choose the page that owns the decision you are making: architecture and lifecycle, configuration, persistence, performance, public API, or limits. The guide intentionally separates those concerns so examples do not accidentally become policy.

Examples#

See MemMap for executable examples that accompany this guide.

See also#

Further reading#

See also