I'm currently coding a new program, which opens a lot of large images (photos) with Gdk::Pixbuf. These are "freed up" correctly (no more alive reference to the object in my program), but the ruby program is never freeing memory to the OS, unless I explicitely trigger the GC. This is a big problem as the computer crawls swapping after a little while :/ I am wondering whether there should be some kind of GC "hints" from rg2 (I have zero knowledge of ruby GC internal)? The following quick test shows that repeatedly allocating and reassigning with Array.new grows memory up until a "reasonable" amount, whereas Gdk::Pixbuf.new does not: http://zarb.org/~gc/t/tmem.rb.out http://zarb.org/~gc/t/tmem.rb Used image is http://zarb.org/~gc/t/pa.jpg (using ruby 1.8.6, rg2 0.16.0, gdk pixbuf 2.10.12) -- Guillaume Cottenceau - http://zarb.org/~gc/ ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/
on 2007-06-29 09:58
on 2007-06-29 11:02
Hi, yesterday i had exactly the same problem. I pumped up to several hundred pixbufs of 640x480 troug a Gtk::Image. I coul follow like the memory got eaten and than the application got stuck caus the swap got active. My solution was to put a GC.start after the assignement of every new pixbuf to the image. That solved the problem nearly completly and for the performance it was also no problem. But i think, that is not the right way. Cheers detlef Am Freitag, den 29.06.2007, 09:58 +0200 schrieb Guillaume Cottenceau: > grows memory up until a "reasonable" amount, whereas Gdk::Pixbuf.new > does not: > > http://zarb.org/~gc/t/tmem.rb.out > http://zarb.org/~gc/t/tmem.rb > > Used image is http://zarb.org/~gc/t/pa.jpg > > (using ruby 1.8.6, rg2 0.16.0, gdk pixbuf 2.10.12) > ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.