There’s also this new possible (global) hint:
I hope, and have high confidence, that this hint option will get redundant though soon. Users should have to and don’t need to worry about max. memory in most cases. They may need to worry about finalizers in some cases; and memory mapped files relating to that, which I believe was your original problem (not show in this example); though you didn’t use such directly, only through a package (and only a problem on Windows…).
It’s helpful to know of. Possibly in that case. I would try to see if it helps with or without that explicit GC.gc(). Or GC.gc(false).
But again, I would try Bumper.jl that solves this if you’re ok with rather trivial (local) code changes.