and without replacement (replace=False) is leaking RAM usage by creating in memory an array the size of the sample size requested, which is not cleared after the function call. So, for instance, asking for 100 random points with a value between 0 and 1 billion, without replacement, will create an array of size 1 billion in memory which stays for a while. See https://github.com/numpy/numpy/issues/14169 and https://github.com/GlacioHack/xdem/discussions/501#discussioncomment-9149146.
And we are currently doing this everywhere :scream:
We need to replace everywhere in GeoUtils and xDEM by:
Turns out using the legacy NumPy random generator
or its equivalent for consistency in the random output:
and without replacement (
replace=False
) is leaking RAM usage by creating in memory an array the size of the sample size requested, which is not cleared after the function call. So, for instance, asking for 100 random points with a value between 0 and 1 billion, without replacement, will create an array of size 1 billion in memory which stays for a while. See https://github.com/numpy/numpy/issues/14169 and https://github.com/GlacioHack/xdem/discussions/501#discussioncomment-9149146. And we are currently doing this everywhere :scream:We need to replace everywhere in GeoUtils and xDEM by: