开发者

ruby memory leak Gdk::PixbufLoader

开发者 https://www.devze.com 2023-01-03 05:33 出处:网络
So I\'m beginning to wonder how leaky the gnome2 libraries for ruby1.8.6 are. #!/usr/bin/env ruby require \'gtk2\'

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 开发者_如何学Pythonabout 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消