a = zeros(4000000000)
resize!(a, 0)
sizehint!(a, 0)
b = zeros(4000000000)
resize!(b, 0)
sizehint!(b, 0)
c = zeros(4000000000)
while true
end
I ran into OutOfMemoryError with the above program. My computer has 64GiB of RAM. According to https://github.com/JuliaLang/julia/pull/26201, I was hoping that when I actually need to create c, a’s and b’s memory have been released instead of running out of memory. Calling gc() doesn’t help. Is there anything I can do to force Julia to release a’s and b’s memory? Thanks!
For what it’s worth, my computer also has 64 gigs, and was able to create c. (Although I didn’t check the swap, I didn’t notice creating c being any slower than the first two).
Did you try?
a = zeros(4000000000);
a = zeros(0);
b = zeros(4000000000);
b = zeros(0);
c = zeros(4000000000);