-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak in imshow #138
Comments
Interesting. I can even comment out the function that does the real work, diff --git a/src/ImageView.jl b/src/ImageView.jl
index 23637e8..a24f669 100644
--- a/src/ImageView.jl
+++ b/src/ImageView.jl
@@ -159,8 +159,9 @@ end
function imshow(c::GtkReactive.Canvas, img::AbstractMatrix, anns=Signal(Dict{UInt,Any}());
kwargs...)
- f = parent(widget(c))
- imshow(f, c, img, default_clim(img), roi(img, default_axes(img))..., anns; kwargs...)
+ # f = parent(widget(c))
+ # imshow(f, c, img, default_clim(img), roi(img, default_axes(img))..., anns; kwargs...)
+ return nothing
end
function imshow(img::AbstractArray, clim; and the memory still grows. However, if I also comment out the default |
Yep, this does it too: julia> using Reactive
julia> function silly(anns=Signal(Dict{UInt,Any}()); kwargs...)
return nothing
end
silly (generic function with 2 methods)
julia> while true
silly()
end |
@AndreHat, a possible solution to your problem is to use the (unexported) ImageView.imshow!(canvas["gui"]["canvas"], testimage, canvas["annotations"]) |
I am using ImageView to display a video feed from a USB camera. After some time my RAM is completely full. After playing around with my code I realized it is the imshow(canvas["gui"]["canvas"], testimage) function that creates the leak. The speed at which my RAM fills are inversely proportional to the size of testimage, so the larger images did not affect me as bad. It doesn't seem as if any garbage collection happens and the memory just fills up till everything breaks.
Please try this sample code and tell me if you get the same result:
Warning: On my computer this code fills 4GB RAM in less than 20 seconds, so stand ready to stop Julia before that happens.
I am Running this on Ubuntu 16.04 using Atom as an IDE.
Can anyone please tell me how to fix this?
The text was updated successfully, but these errors were encountered: