rafaqz / Rasters.jl

Raster manipulation for the Julia language
MIT License
209 stars 36 forks source link

check memory use in coverage before allocating for a specified `scale` #666

Closed rafaqz closed 4 months ago

rafaqz commented 4 months ago

Its possible to crash julia currently when calling coverage by using a large scale value (like 10000 or just 1000 if your array is big enough).

This PR checks system memory before we allocate buffers and throws some helpful errors and warnings.

If the problem comes from threaded, we switch to single threaded so save buffer memory, but warn when we do that.

Closes #661