# Julia 1.4.2 memory cleaning error? Windows?

**URL:** <https://discourse.julialang.org/t/julia-1-4-2-memory-cleaning-error-windows/48347>\
**Category:** General Usage\
**Created:** [October 14, 2020, 8:06am UTC](https://discourse.julialang.org/t/julia-1-4-2-memory-cleaning-error-windows/48347 "2020-10-14T08:06:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![timmm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/timmm/32/6760_2.png) [@timmm](https://discourse.julialang.org/u/timmm)\
**Post date:** [October 14, 2020, 8:06am UTC](https://discourse.julialang.org/t/julia-1-4-2-memory-cleaning-error-windows/48347/1 "2020-10-14T08:06:04Z")

</div>

Hi all,

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

```julia
x=[1 2 3 4 5]
for i=1:5
func(x[i])
end

```

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.  
Cheers,  
Tim

---

<div class="post-metadata">

**Author:** ![Iulian.Cioarca](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iulian.cioarca/32/30166_2.png) [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Post date:** [October 14, 2020, 11:11am UTC](https://discourse.julialang.org/t/julia-1-4-2-memory-cleaning-error-windows/48347/2 "2020-10-14T11:11:20Z")

</div>

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