-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
GCGarbage collectorGarbage collector
Description
Hi there
I found a small example to reproduce a memory leak which kept me busy for several days. (Hoping to find a workaround soon).
Running the following in Julia REPL several times will show an increase in memory usage (about 200 KB per run).
begin
forecast_samples = [randn(30) for i in 1:10_000]
sums = vec(mapslices(sum, reduce(vcat, forecast_samples'), dims=1))
GC.gc(); Base.gc_live_bytes() / 2^20
endFor sure this example is not yet minimal, but at least super tiny.
(tested on Julia 1.9.0 and 1.9.1)
EDIT: Just realized that gc_live_bytes is quite noisy. Hence better do the above a couple of times. E.g.
[begin
forecast_samples = [randn(30) for i in 1:10_000]
sums = vec(mapslices(sum, reduce(vcat, forecast_samples'), dims=1))
GC.gc(); Base.gc_live_bytes() / 2^20
end for i in 1:50]Pangoraw, Seelengrab, pankgeorg, bartvanerp, xzackli and 3 more
Metadata
Metadata
Assignees
Labels
GCGarbage collectorGarbage collector