﻿# Dask worker pause: running tasks can keep increasing memory

Interpret Dask spilling, process-memory pause and nanny termination separately when a paused preprocessing worker still grows toward failure.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/dask-worker-memory-pause-spill/
Language: en

A Dask dashboard marks a worker paused, yet a running decode task continues allocating until the nanny restarts it. Pause did not necessarily fail. Its documented action is to stop starting additional tasks, while already executing code can still create memory pressure that spilling cannot remove.

## Record the active memory policy

The [worker-memory guide](https://distributed.dask.org/en/stable/worker-memory.html) distinguishes managed-memory spill, process-memory spill, pause and nanny termination. Save the effective configuration rather than assuming documented defaults match the deployment. Name which process is supervised and whether a nanny exists. A worker memory target is not proof that an arbitrary allocation will be rejected before crossing it. The timing and scope of each protective action matter when interpreting a rapid spike.

## Separate managed values from task intermediates

Managed memory estimates stored task results. Process memory includes additional allocations such as active intermediates, interpreter state, network buffers and allocator-retained pages. Spilling unused managed values may not release the memory driving the spike. The [GPU spill granularity guide](/journal/fg2-dask-cuda-spill-task-buffer-granularity/) explains the adjacent device tier. Keep host and device observations separate: a successful device spill can increase host pressure, and host policy cannot directly explain every allocation on an accelerator.

## Read what pause actually does

The guide says pause stops the worker pool from starting more queued computations while currently executing tasks continue. It also throttles transfers. A long-running task can therefore keep growing after pause appears. Record active task identities and their allocation phases alongside the state transition. Do not interpret a paused worker as a frozen process or claim a memory bound from that status. The relevant question is whether existing work can finish within the remaining physical headroom.

## Preserve evidence before termination

If the nanny's configured termination boundary is reached, the worker can be killed and restarted. Keep memory categories, task identifiers, spill activity and the supervisor's reason together. The [resilience guide](https://distributed.dask.org/en/stable/resilience.html) explains why graph-produced data may be recomputed while scattered values have no production history. A restart thus has a data consequence as well as a scheduling consequence. The [checkpoint guide](/journal/fg2-ray-tune-function-checkpoint-state-report/) illustrates why application continuation requires coherent saved state rather than a healthy replacement process alone.

## Compare partition and concurrency changes

In a disposable workload, hold input meaning fixed while comparing a smaller partition with reduced simultaneously executing tasks. Observe peak intermediates, managed values, process memory and pause/termination events. These changes address different causes: task size affects one operation's demand; concurrency changes overlapping demand. Acceptance should show which demand exceeded the policy's protection. No specific safe partition size, memory percentage or achieved improvement is asserted without the deployment's actual evidence.

## Keep allocator retention distinct from leaks

The worker guide notes that high process memory can include allocator-retained reusable space, so unmanaged memory alone does not prove a leak. Conversely, that distinction does not make physical pressure harmless to the node. Preserve the measurement definition and a bounded trend across completed tasks before selecting a remedy. The supported result is an explained control sequence and a workload policy whose active tasks can complete within tested capacity, not a promise that enabling spilling or pause prevents every out-of-memory failure.
