-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
GCGarbage collectorGarbage collector
Description
Hi, there
I think that automatic garbage collection does not work for SharedArray Datatype.
Only explicit calling gc function deallocate SharedArrays that are useless.
What I am using version 0.6.2
The below code works well.
function main()
sz = 10000
for i=1:100
sm = SharedMatrix{Float64}(sz, sz)
# SharedMatrix is not allocated before they use.
# So explicit access is required to make them being allocated.
for x=1:sz
for y=1:sz
sm[x,y] = i
end
end
println(i, " ", sm[1,1])
gc()
end
end # main
main()
However, the below code makes a crash.
function main()
sz = 10000
for i=1:100
sm = SharedMatrix{Float64}(sz, sz)
for x=1:sz
for y=1:sz
sm[x,y] = i
end
end
println(i, " ", sm[1,1])
#gc() without explicit gc() call.
end
end # main
main()
The reason of this crash is the limitation of allocating shared memory.
Metadata
Metadata
Assignees
Labels
GCGarbage collectorGarbage collector