Home Knowledge Base Pinned (Page-Locked) Memory

Pinned (Page-Locked) Memory is host memory that is locked in physical RAM and cannot be swapped to disk — enabling the GPU to access host memory directly via DMA without CPU involvement and allowing asynchronous (overlapping) memory transfers.

Why Pinned Memory?

1. Allocate temporary pinned buffer. 2. Copy from pageable → pinned (CPU). 3. DMA transfer pinned → GPU.

Allocating Pinned Memory

float* h_data;
cudaMallocHost(&h_data, size);     // Pinned allocation
cudaFreeHost(h_data);              // Free pinned memory

// Async transfer (non-blocking)
cudaMemcpyAsync(d_data, h_data, size, cudaMemcpyHostToDevice, stream);

Zero-Copy Memory

When to Use Pinned Memory

When NOT to Overuse

Pinned memory is a prerequisite for achieving peak PCIe bandwidth and enabling the transfer-compute overlap that allows GPU inference and training pipelines to saturate GPU compute without waiting for data transfers.

pinned memory cudapage locked memoryzero copy memorymapped memoryhost memory cuda

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.