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.
Create an anonymous or file-backed mapping and close it deterministically.
Read/write mapped ranges, context management, offsets, and ownership.
Use mprotect, msync, and mlock with platform-aware expectations.
MemoryMap, mmap_region, flags, validation helpers, and exceptions.
Page alignment, permissions, native-build requirements, and portability.
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
https://numpy.org/doc/stable/reference/generated/numpy.memmap.html
numpy.memmap
scipy.io
mmap (Python standard library)