Skip to content

Memory leak with a specific Dask import #2862

@arthur-st

Description

@arthur-st

Describe the Bug

I'm running Windows 11 Pro 24H2 (26100.7840), and I can reproducibly cause a memory leak by importing dask.array as follows (using uv --version = uv 0.10.10 (8c730aaad 2026-03-13)):

  1. Create a blank project with uv init --python=3.13.12
  2. uv add dask==2025.5.1
  3. uv add pyrefly==0.57.1
  4. Enter the environment with .\.venv\Scripts\activate.ps1
  5. Run pyrefly init
  6. Set main.py to match the code snippet below (entire file).
  7. Run pyrefly check
  8. Observe frozen pyrefly and the process memory steadily climbing.
import dask.array as da


def main(foo):
    x = da.nanmin(foo)

This also happens with the IDE extension and with other environment managers, e.g., the project where I found this originally uses pixi. I have not tried searching if a “future” dask release remediates this internally, but at a glance dask==2026.3.0 (the latest stable) has the same issue.

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions