Suppose a static-file server needs to send a 1 GB file over a socket. The application does not inspect or modify the data, yet a traditional approach copies every byte through a temporary user-space buffer:
That buffer exists only to move unchanged data from the file to the socket. For large transfers, these extra copies consume CPU time, memory bandwidth, and cache space.
Zero-copy techniques reduce this overhead by avoiding one or more unnecessary copies through user space.
The name can be misleading: the data may still move between storage, memory, and network devices. The key idea is simply to remove unnecessary CPU-mediated copies from the data path.
This chapter traces the conventional transfer path, compares sendfile, splice, tee, vmsplice, mmap, and MSG_ZEROCOPY, and explains when copy avoidance improves end-to-end performance.