Julia 1.4.2 memory cleaning error? Windows?

Hi all,

I am using a script in julia 1.4.2 at the moment such as:

x=[1 2 3 4 5]
for i=1:5

where ‘func’ is a function creating and using a dense large matrix (arrox 12GB) (mutable), which is close to my memory limit (16GB). When ‘i’ is 1 this runs fine, on the second loop (i==2) it gets stuck, my memory is full, I have checked and it ran for over 24 hours before I kill it.
But the second loop will run fine if the first hasn’t (and so on).
It is got to the point now where I manually run the loop in different instances of Julia (close to a submission deadline at the moment).

Ps I didn’t know what to say in the title but I am assuming julia is not cleaning the memory for the 2nd loop.

Help appreciated.

Did you try forcing garbage collection after func(x[i]) with GC.gc()?