#79827·Paddle

paddle.inference leaks ~4 KB of host memory per run() on GPU (one page per inference); the same model on CPU does not

Author: sergolubCreated Sep 28, 2026Updated Sep 28, 2026

Bug description

Every GPU inference through paddle.inference permanently adds about 4 KB to the process's resident host memory. The growth is exactly linear in the number of calls and does not stop: a long-running service grows without bound and has to be restarted.

The same predictor, the same model and the same script on the CPU do not show it. Nothing but paddle.inference is in the loop — no PaddleOCR, no PaddleX, no user code, and the input tensor is allocated once and reused.

Paddle's own device-memory counter (paddle.device.cuda.memory_allocated()) stays constant at 7.4 MB throughout, so what grows is host memory, not device memory.

Environment

Reproduced independently on two machines, both Windows 11, Python 3.9, paddlepaddle-gpu==3.3.1 from the cu129 index:

  | machine A | machine B -- | -- | -- GPU | RTX 3060 | RTX 5060 Ti Compute capability | 8.6 (Ampere) | 12.0 (Blackwell) Driver / CUDA | 12.9 | 576.57 / 12.9 leak | 4085 B/call | 3837 B/call