GPU Memory Fragmentation and CUDA Context Management
Profiling GPU VRAM allocation patterns under concurrent inference workloads and testing context-level isolation strategies.
Fragmentation Analysis
- Sustained long-running CUDA contexts with varying tensor sizes cause heap fragmentation; peak contiguous free block drops to 34% of total VRAM after 6+ hours of inference workload.
- CUDA memory pool allocator (cudaMemPool) tested with auto-release policy — reduces fragmentation by ~22% without explicit cudaFree calls per request.
- Multi-process service (MPS) daemon enabled on primary GPU node to prevent context migration overhead between SMs.
Allocation Monitoring
nvidia-smi -q -d MEMORY,UTILIZATION,FREQ ; Peak util: 94%, Mem used: 17.2/24 GB, Fragmented: ~6.8 GB