This PR attempts to work around memory usage issues in a similar manner to the Julia GPU packages: when poolset is called, if we're running low on memory (according to a configurable threshold), then we do increasingly expensive calls to the GC to try to free up enough memory to avoid an OOM.
An enhancement that we could make is to keep trying to GC until we don't free any memory. To be investigated.
@stevenwhitaker @svilupp this might help with the OOM issues seen with your workloads.
@krynju I'm considering enabling this by default, do you have any objections to that?
This PR attempts to work around memory usage issues in a similar manner to the Julia GPU packages: when
poolset
is called, if we're running low on memory (according to a configurable threshold), then we do increasingly expensive calls to the GC to try to free up enough memory to avoid an OOM.An enhancement that we could make is to keep trying to GC until we don't free any memory. To be investigated.
@stevenwhitaker @svilupp this might help with the OOM issues seen with your workloads.
@krynju I'm considering enabling this by default, do you have any objections to that?