﻿# GPU memory oversubscription: the active working set decides movement

Managed-memory oversubscription is governed by active working-set locality; allocation success cannot predict the cost of repeated page eviction and return.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/learn-managed-oversubscription-working-set/
Language: en

On supported systems, managed allocations can exceed the memory capacity physically available on a GPU. That capability extends what can be addressed; it does not provide device-memory bandwidth for an arbitrarily large active dataset. The important distinction is between total allocation and the subset repeatedly touched during a phase. Poor locality can turn an apparently successful allocation into constant page movement.

## Capacity and working set answer different questions

The allocation size describes how much addressable storage the application requests. The working set describes which pages it needs within a meaningful reuse interval. A large archive processed in localized chunks can behave differently from a smaller graph whose random accesses continually revisit distant pages. Estimate the active reuse interval from the algorithm. Aggregate bytes alone cannot explain whether data will remain available long enough to be reused efficiently.

Primary reference: [CUDA Programming Guide: Unified Memory](https://docs.nvidia.com/cuda/cuda-programming-guide/04-special-topics/unified-memory.html).

## Thrashing spends bandwidth without progress

When useful pages repeatedly evict other pages that will soon be needed again, the system can spend substantial effort moving data rather than advancing computation. A kernel may remain active while useful work progresses slowly. Increasing the allocation limit does not repair this access pattern. Look for repeated migrations associated with the same phase and compare them with the amount of unique useful data actually processed during that phase.

Primary reference: [CUDA C++ Best Practices Guide](https://docs.nvidia.com/cuda/cuda-c-best-practices-guide/).

## Chunking changes the reuse distance

A blocked algorithm can finish several operations on a local region before moving to another. This shortens the distance between uses of the same pages. For example, processing an entire local subproblem before revisiting unrelated regions can preserve more useful locality than sweeping every large array between stages. Chunk size must also accommodate temporary tensors and runtime allocations; filling nominal capacity with inputs alone leaves no room for the computation's other needs.

Primary reference: [CUDA Programming Guide: Writing SIMT Kernels](https://docs.nvidia.com/cuda/cuda-programming-guide/02-basics/writing-cuda-kernels.html).

## Prefetch cannot make every page resident

Prefetch can prepare an upcoming region, but requesting more than the practical resident capacity does not force unlimited local storage into existence. An oversized preparation phase may displace the current working set or simply move the bottleneck. Prepare the next useful chunk while maintaining a clear ownership and dependency plan. Evaluate preparation and processing together, especially when multiple streams or processes share the same device memory resource.

## Pressure tests reveal the real boundary

Vary the active working set while holding the arithmetic per useful element stable. Observe total completion time, migration activity, and sensitivity to unrelated memory consumers. Avoid presenting the point where allocation fails as the only capacity limit. A practical boundary can appear earlier, where throughput becomes unstable or tail latency grows. Record the access pattern and system capabilities so another engineer can understand why the result applies to that workload.

Related reading: [A GPU inference benchmark you can trust](/journal/inference-benchmark-method/); [Reproducible inference stacks: preserving a GPU pilot’s result](/journal/software-stack-reproducibility/).
