Zero Copy Data Sharing via Shared Memory

61 concepts52 papers1 proposal

When two independent processes need to share data, the traditional operating system path is fraught with friction. Typically, the sender serializes an object into a byte stream, copies it from user space to kernel space via a system call, and the receiver reverses this entire sequence. When dealing with high-throughput pipelines—such as real-time video processing, distributed machine learning training, or main-memory databases—this constant duplication of bytes consumes massive CPU cycles and saturates memory bandwidth.

Zero-copy data sharing bypasses this bottleneck entirely. Instead of moving data across process boundaries, systems manipulate the underlying virtual memory system so that multiple execution contexts point to the exact same physical memory pages.

The Core Mechanism: Virtual Address Mapping

To understand why zero-copy sharing works, we must look at how operating systems isolate processes. Each process operates within its own isolated virtual address space, managed by page tables that map virtual addresses to physical RAM.

In a traditional Inter-Process Communication (IPC) setup, data transfer requires physically copying bytes from one process's memory pages to another's. Zero-copy architectures eliminate this by mapping a single region of physical memory into the virtual address spaces of multiple processes simultaneously.

As demonstrated by Yuxin Xiang in Bindox: An Efficient and Secure Cross-System IPC Mechanism for Multi-Platform Containers, mapping the memory buffers of both the sender and receiver to the same physical location allows data to be transferred conceptually without ever being moved physically. The memory footprint remains identical to the size of the data itself, completely avoiding kernel-level buffering and redundant allocation.

Bypassing Storage and Buffer Managers

The historical roots of this technique lie in database design. Traditional relational databases were built around the assumption that data lives on slow disks, requiring a complex "buffer manager" to fetch blocks into RAM, track modifications, and flush them back to disk.

When datasets fit entirely within modern RAM capacities, this buffer management layer becomes a primary performance tax. H. V. Jagadish et al. in Dalí: A High Performance Main Memory Storage Manager pioneered an architecture that maps database files directly into the virtual address space of user processes. This allows client applications to read and write database structures using direct memory pointers, eliminating context switches between client and server processes.

This concept was advanced by Jerry Baulier et al. in DataBlitz: A High Performance Main-Memory Storage Manager, confirming that treating memory as the primary storage medium rather than a cache can yield massive speedups. By removing the buffer manager entirely, applications achieve raw shared-memory speeds while preserving transactional safety. As argued by Michael Stonebraker et al. in The End of an Architectural Era (It's Time for a Complete Rewrite), stripping away legacy disk-oriented components is essential for modern hardware to achieve its true throughput potential.

Eliminating Serialization in High-Throughput Pipelines

In modern distributed frameworks and machine learning workloads, the primary bottleneck has shifted from disk I/O to language interpreter locks and object serialization. For example, passing large data structures between Python processes typically requires "pickling" (serializing) the data, which destroys performance.

To scale distributed workloads, systems use shared-memory object stores. Eric Liang et al. in RLlib: Abstractions for Distributed Reinforcement Learning leverage this approach to let multiple concurrent workers access massive data structures, such as neural network weights, without any serialization or data duplication overhead.

Similarly, in high-throughput reinforcement learning environments where environments generate millions of video frames, Aleksei Petrenko et al. in Sample Factory: Egocentric 3D Control from Pixels at 100000 FPS with Asynchronous Reinforcement Learning utilize shared memory tensors coupled with a high-speed FIFO queue. Instead of pushing the actual image data through the queue, the system passes only tiny memory indices (pointers). The receiving process uses the index to read the tensor directly from the shared memory space, unlocking frame rates exceeding 100,000 FPS on a single workstation.

Bridging Language and Hardware Boundaries

Zero-copy memory mapping is also a vital tool for bridging heterogeneous execution environments, such as connecting a high-level managed language (Python, Java) to a low-level native engine (C++) or a hardware accelerator (GPU).

When a Python script calls a high-performance C++ backend, converting data structures back and forth creates severe friction. To mitigate this, Zhaokang Wang et al. in UniGPS: A Unified Programming Framework for Distributed Graph Processing implement memory-mapped buffers that map the same physical memory region to both the high-level language runner and the low-level execution engine, enabling near-instantaneous state exchange.

This boundary crossing extends directly to hardware drivers. Kai Zou et al. in GX-Plug: a Middleware for Plugging Accelerators to Distributed Graph Processing utilize System V IPC shared memory regions to establish direct data paths between managed language runtimes and native hardware drivers. This ensures that the massive computational speedups offered by hardware accelerators are not entirely negated by the overhead of moving data across the software-hardware boundary.

Coordination, Safety, and Signaling

If multiple independent processes are pointing to the exact same physical memory addresses, how do they avoid corrupting each other's data? The literature highlights three core strategies for maintaining safety and coordination in a zero-copy architecture:

  1. Hybrid Signaling: Rather than abandoning traditional networking or socket protocols entirely, systems often split their communication. Yu-Ping Wang in TZC: Efficient Inter-Process Communication for Robotics Middleware with Partial Serialization demonstrates a hybrid approach where standard socket-based signaling is retained for lightweight control flow and synchronization metadata, while the heavy data payloads are offloaded to POSIX shared memory.
  2. Strict Ownership Type Systems: Memory safety can be guaranteed at compile time rather than relying on runtime locks. Jesper Honig Spring et al. in Streamflex: high-throughput stream programming in java show that enforcing strict ownership boundaries within a language's type system allows isolated processing units to safely pass pointers. Once a pointer is transferred, the sender loses access, preventing race conditions without requiring data copies.
  3. Lock-Free Data Structures: To prevent processes from blocking each other, zero-copy systems frequently organize shared memory regions into lock-free circular ring buffers. By utilizing hardware-level atomic primitives (such as compare-and-swap), processes can safely append and consume data indices concurrently with minimal latency.

Key Foundational Work

Dalí: A High Performance Main Memory Storage Manager (1994) — contributed 2 concept elements to this direction.
Recent Developments in Butterfly™ Lisp (1987) — contributed 1 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_zero_copy_data_sharing_50badd82,
  title = {zero-copy data sharing},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/zero-copy-data-sharing/rdr_50badd82f22a42aeaa745d8d5bbb3d5d},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-20},
}

This exact version (version 1, frozen text):

@misc{lacuna_zero_copy_data_sharing_50badd82_v1,
  title = {zero-copy data sharing},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/zero-copy-data-sharing/rdr_50badd82f22a42aeaa745d8d5bbb3d5d/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-20},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake