Skip to content

erosion dask paths materialize full array without memory guard #1120

@brendancol

Description

@brendancol

Describe the bug

_erode_dask_numpy (line 341) and _erode_dask_cupy (line 352) call .compute() on the full dask array with no memory check. The algorithm is inherently global (particles traverse the full grid), so this can't be fixed with chunking, but there's no guard to prevent OOM on oversized inputs.

Expected behavior

Add a memory guard that estimates working set size and raises MemoryError before .compute() on inputs that won't fit. The docstring already documents the limitation — the guard makes it fail fast with an actionable message instead of letting the OS OOM killer intervene.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghigh-priorityoomOut-of-memory risk with large datasets

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions