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.
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
MemoryErrorbefore.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.