Open cstjean opened 4 years ago
julia> function mk_obs()
f = rand(100_000_000)
obs = Observable(0)
on(obs) do _
println(maximum(f))
end
obs
end
mk_obs (generic function with 1 method)
does not leak memory, so it's something about the widgets. Is anything holding a reference to it? With the dropdown,
julia> WebIO.observ_id_dict
WeakKeyDict{Any,Any} with 2 entries:
Observable{Any} with 2 l… => (WeakRef(Scope(Node{DOM}(DOM(:html, :div), Any[N…
Observable{Any} with 1 l… => (WeakRef(Scope(Node{DOM}(DOM(:html, :div), Any[N…
after GC.
I'm guessing it's some variant of https://discourse.julialang.org/t/weakkeydict-x-x-holds-on-to-memory/34187.
Yeah, this is essentially just https://github.com/JuliaGizmos/WebIO.jl/issues/321.
It's being tackled in https://github.com/JuliaGizmos/WebIO.jl/issues/368, but my day job has picked up and I haven't had the time to work on it recently.
On Interact v0.10.3, Julia 1.3.1, the following code leaks memory:
Memory usage goes up after each call, even after
GC.gc()
.