CUDA Unified Memory
**CUDA Unified Memory Advanced Patterns** is **an advanced GPU memory management feature enabling transparent migration of data between host and GPU memories through unified virtual address space — enabling sophisticated programming patterns with automatic memory management while requiring careful optimization to prevent performance degradation from excessive data movement**. CUDA unified memory provides single virtual address space spanning both host (CPU) and GPU memories, enabling pointers to reference either host or GPU memory transparently without explicit cudaMemcpy calls. The page-based migration mechanism moves data between host and GPU memory at page granularity (typically 4KB or larger), with hardware page faults triggering migration on-demand when GPU or host accesses non-resident pages. The demand paging overhead can be significant when working sets exceed GPU memory capacity, requiring careful application design to avoid excessive page migration overhead. The memory over-subscription patterns in unified memory enable applications to process datasets larger than GPU memory by leveraging host memory as backing storage, though with performance degradation from frequent page migrations. The memory prefetch hints enable explicit specification of where data should reside, enabling proactive migration before GPU access to avoid page fault overhead. The memory advise hints enable specification of access patterns and memory placement policies, providing guidance to unified memory system for optimization of migration patterns. The performance analysis of unified memory applications requires careful measurement of page migration overhead and identification of inefficient access patterns causing excessive migration. **CUDA unified memory provides transparent data migration between host and GPU memories enabling flexible memory management with careful optimization to minimize migration overhead.**