I'm experiencing a memory leak on ruby 2.3.1 with gtk-3. On my system (Ubuntu 16-04) the following code consumes approximately 80 MB. The size of picture.jpg is 289kb.
`require 'gtk3'
def ptest
i=0
j=0
loop {
i += 1
j += 1
exit if j==50
@image = Gtk::Image.new
newPixbuf = GdkPixbuf::Pixbuf.new(:file => "picture.jpg")
@image.pixbuf = newPixbuf
@image.clear
@image=nil
if i == 10
p "GC"
GC.start
i = 0
end
}
end
ptest`
According https://sourceforge.net/p/ruby-gnome2/mailman/message/8659687/ this shouldn't happen. What can I do to release the memory?
What version of gtk3 gem are you using?
It seems that it has been fixed in the latest release (or master).
The latest package has been fixed this problem.