Menu

#188 Memory leak on ruby gtk-3

v1.0_(example)
closed
nobody
None
5
2017-05-07
2017-04-07
Jogan Thums
No

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?

Discussion

  • Kouhei Sutou

    Kouhei Sutou - 2017-04-10

    What version of gtk3 gem are you using?
    It seems that it has been fixed in the latest release (or master).

     
  • Kouhei Sutou

    Kouhei Sutou - 2017-05-07
    • status: open --> closed
     
  • Kouhei Sutou

    Kouhei Sutou - 2017-05-07

    The latest package has been fixed this problem.

     

Log in to post a comment.