Page 1 of 1

ImageMagick for Ruby programmers: RMagick vs. MiniMagick

Posted: 2009-06-19T07:51:53-07:00
by pitosalas
This might be of interest to folks on this board:

http://www.salas.com/2009/06/19/geeky-r ... ory-leaks/

Re: ImageMagick for Ruby programmers: RMagick vs. MiniMagick

Posted: 2009-06-19T08:40:01-07:00
by magick
The development version of RMagick includes an enhancement to use the Ruby garbage collector. You will need to contact the author of RMagick to determine its release date.

Re: ImageMagick for Ruby programmers: RMagick vs. MiniMagick

Posted: 2009-06-21T09:41:21-07:00
by rmagick
RMagick 2.10.0 can use the Ruby garbage collector. You must build it with ImageMagick 6.5.3-10. See my post on the RMagick Hints and Tips Forum on RubyForge: http://rubyforge.org/forum/forum.php?th ... um_id=1618.

Re: ImageMagick for Ruby programmers: RMagick vs. MiniMagick

Posted: 2009-06-22T06:22:06-07:00
by pitosalas
What does 'using Ruby memory management mean?" I assume(d) that RMagick would place a pointer to the ImageMagick object in a Ruby object. Even if RMagick now causes the ImageMagick object to be released once the corresponding RMagick Image object is garbage collected, this may not be enough. Because the RMagick object will be so much smaller (given that the actual image data is stored in malloc-land out of the view of Ruby, the GC would not be triggered until long after tons of memory has been tied up.

Or does the RMagick / Ruby GC go further than that?

Re: ImageMagick for Ruby programmers: RMagick vs. MiniMagick

Posted: 2009-06-22T14:27:20-07:00
by rmagick
All ImageMagick memory allocations and frees are handed off to Ruby. This means that Ruby's GC knows about all the memory that's in use and free and can run garbage collections accordingly. Image objects are just like arrays, hashes, or any other Ruby objects.

See my post on the RMagick Hints and Tips forum for information about how to enable this support. If you decide to try it please share your experience.