ruby memory leak Gdk::PixbufLoader

Posted by Reed Debaets on Stack Overflow See other posts from Stack Overflow or by Reed Debaets
Published on 2010-06-10T19:17:59Z Indexed on 2010/06/10 19:23 UTC
Read the original article Hit count: 341

Filed under:
|
|
|

So I'm beginning to wonder how leaky the gnome2 libraries for ruby1.8.6 are.

#!/usr/bin/env ruby
require 'gtk2'
while true
   sleep 0.1
   pixbuf = Gdk::PixbufLoader.new
   pixbuf = nil
end

this leaks about 16kb/sec according to watch -n 1 ps -o rss -p <process id>

This is compounded if you start trying to write a chunk of large chunks of image data to it using pixbuf.last_write img_data

Any ideas how to get around this (and the second issue)? I need to update image data within my code but it seems like anything that ends up using a pixbuf leaks like a sieve.

© Stack Overflow or respective owner

Related posts about ruby

Related posts about memory-leaks