Page-locked memory, also called pinned memory, is host (CPU) memory that the operating system is prevented from paging out to disk. This locking enables Direct Memory Access (DMA) transfers, where a GPU can copy data directly from this stable host region to its device memory without CPU intervention, achieving maximum PCIe bandwidth and lower latency. It is essential for overlapping computation and data transfer via CUDA streams.
Glossary
Page-Locked Memory (Pinned Memory)

What is Page-Locked Memory (Pinned Memory)?
A foundational technique for high-performance data transfer between CPU and GPU memory.
Using page-locked memory incurs a cost: it reduces the amount of flexible, pageable memory available to the host system and can lead to memory pressure if over-allocated. It is therefore used strategically for staging areas of data actively being transferred. The CUDA APIs cudaHostAlloc() and cudaHostRegister() are used to allocate or pin existing memory. This technique is a prerequisite for advanced optimizations like zero-copy access and GPUDirect RDMA between devices.
Key Characteristics of Pinned Memory
Page-locked memory is a foundational technique for high-performance GPU computing. Its defining characteristics enable the direct, high-bandwidth data transfers essential for minimizing inference latency.
Prevents OS Paging
The operating system's virtual memory manager normally pages inactive memory to disk. Pinning a region of host (CPU) memory instructs the OS to lock those pages in physical RAM, guaranteeing they will not be swapped out. This is the core mechanism that enables reliable, high-speed Direct Memory Access (DMA) transfers to the GPU, as the physical address of the data remains constant and resident.
Enables Direct Memory Access (DMA)
With pinned memory, the GPU's DMA engine can directly read from or write to the host memory buffer without CPU intervention. This bypasses the need for staged copies through CPU registers, which is slower and consumes CPU cycles. The transfer occurs over the PCIe bus at near-peak hardware bandwidth, which is critical for feeding data-hungry models and reducing I/O-bound latency during inference.
- Without Pinning: Data must be copied to a temporary, non-pageable buffer first.
- With Pinning: DMA transfer is initiated directly from the application's buffer.
Higher Bandwidth Transfers
Pinned memory allocations allow the use of the full bandwidth of the PCIe bus. On modern systems with PCIe 4.0 or 5.0, this can mean transfer speeds of 16-64 GB/s. In contrast, transfers involving pageable memory are typically slower because the driver must first stage the data through a pinned buffer, adding overhead and reducing effective throughput. This characteristic is vital for workloads with large batch sizes or models with substantial input/output tensors.
Overhead & Allocation Cost
Pinning memory is a privileged operation with significant overhead. Allocating pinned memory (e.g., via cudaHostAlloc) is orders of magnitude slower than standard malloc or new. It also reduces the amount of memory available for the OS to page, which can impact overall system performance if used excessively. Therefore, it is used strategically—often as a pooled, reusable resource—for staging areas of data that are frequently transferred, rather than for all host allocations.
Asynchronous Transfers & Overlap
Pinned memory is a prerequisite for asynchronous memory transfers using CUDA streams. Functions like cudaMemcpyAsync can overlap data movement with kernel execution on the GPU, hiding transfer latency. This requires the host memory source/destination to be pinned. This overlap is a cornerstone of achieving high GPU utilization, as the compute engines can process data from one batch while the next batch is being transferred in parallel.
Relationship to Unified Memory
Unified Virtual Memory (UVM) systems often use pinned memory as a performance optimization under the hood. When data is frequently accessed by the GPU, the UVM driver may implicitly pin those host memory pages to accelerate migration and access. Explicit pinned memory gives the developer direct control, while UVM offers convenience with automatic management, sometimes at the cost of predictable performance. They are complementary techniques in the memory hierarchy.
How Page-Locked Memory Works
Page-locked memory, also known as pinned memory, is a critical host-side optimization for accelerating data transfers to GPU device memory, directly impacting inference latency and throughput.
Page-locked memory is host (CPU) memory that the operating system is prevented from paging out to disk. This 'pinning' allows the GPU's Direct Memory Access engine to perform high-bandwidth, asynchronous transfers directly between this stable host region and device memory. Without pinning, the OS could move data during a transfer, causing faults or requiring the DMA engine to use slower, staged copies via intermediate buffers, which introduces significant latency.
The primary technical mechanism is the cudaHostAlloc() function or the cudaHostRegister() call, which locks the physical pages of an existing buffer. This creates a contiguous physical address range essential for DMA. While it reduces available system memory for paging, the trade-off is justified for high-throughput inference pipelines where data staging (e.g., pre-processing) and model execution must overlap. It is a foundational technique used alongside unified virtual memory and zero-copy transfers for optimal data movement.
Primary Use Cases in AI/ML
Page-locked memory is a foundational technique for high-performance data transfer between CPU and GPU, directly impacting training and inference latency. Its primary applications center on eliminating a critical bottleneck.
System Considerations and Trade-offs
Using page-locked memory is not free and requires careful management:
- Resource Exhaustion: Pinned memory is a scarce system resource. Over-allocation can starve the OS and other processes, leading to system instability or triggering the OOM Killer.
- Allocation Overhead: Allocating pinned memory (
cudaHostAlloc) is significantly slower than allocating pageable memory (malloc). Best practice is to pre-allocate pools of pinned memory at initialization and reuse them. - NUMA Effects: On multi-socket systems, performance depends on which CPU socket's memory is pinned. For optimal PCIe bandwidth, memory should be pinned on the CPU socket physically connected to the target GPU (NUMA-aware allocation).
- Not a General Substitute: It is only beneficial for memory that is frequently transferred. Large, rarely accessed datasets should remain in pageable memory.
Pinned Memory vs. Standard Pageable Memory
A technical comparison of memory allocation strategies for CPU-GPU data transfer, focusing on performance, system impact, and use cases for high-performance computing and machine learning inference.
| Feature / Characteristic | Standard Pageable Memory | Page-Locked (Pinned) Memory |
|---|---|---|
OS Pageability | ||
DMA Transfer Support | ||
Allocation Overhead | Low (standard malloc) | High (requires OS syscall, physical contiguity) |
Transfer Latency (Host→GPU) | High (CPU staging copy required) | Low (direct DMA) |
Effective Bandwidth | < 8 GB/s (PCIe Gen3 x16) |
|
Host Memory Pressure | Low (pages can be swapped to disk) | High (locks physical RAM, reduces available system memory) |
Suitable Transfer Size | Small, infrequent transfers | Large, frequent bulk transfers (e.g., model weights, batch data) |
Primary Use Case | General-purpose computing, non-critical transfers | High-throughput inference, training data pipelines, low-latency HPC |
System Stability Risk | Low | Medium-High (excessive pinning can cause system OOM) |
CUDA API Function | cudaMallocHost (without CUDA_MEMHOSTALLOC_DEVICEMAP) | cudaHostAlloc (with cudaHostAllocDefault or cudaHostAllocPortable) |
Memory Footprint | Virtual only until accessed | Physical RAM allocated immediately and held |
Frequently Asked Questions
Page-locked memory, also known as pinned memory, is a critical host-side memory management technique for enabling high-performance data transfers to GPU device memory. These questions address its core mechanisms, trade-offs, and practical implementation.
Page-locked memory, also called pinned memory, is host (CPU) memory that the operating system is prevented from paging out to disk. This is achieved through system calls like mlock() on Linux or VirtualLock() on Windows. By locking the physical pages in RAM, it enables the GPU's Direct Memory Access (DMA) engine to perform high-bandwidth, asynchronous transfers directly between the host memory and GPU device memory without CPU intervention. Without pinning, the OS could move pages during a transfer, causing DMA errors or requiring the driver to create a temporary pinned copy, adding latency and overhead.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Page-locked memory is a foundational technique within GPU memory optimization. Its primary purpose is to accelerate data movement, but it interacts with several other critical memory management concepts.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us