Calling GC.start with attachment_fu and RMagick -- where or if?

RMagick (and ImageMagick) have been criticized for memory leaks,
though the problem is avoidable by timely garbage collection – see
this thread:

Attachment_fu does not call GC.start in any fashion that I can see, so
my questions are these: does it need to, and if so, where would be the
optimal place? It appears that
AttachmentFu::Processors::RmagickProcessor#with_image may be the right
method – perhaps in the ensure clause? Somewhere else?

Or should GC.start be called in one’s app at, say, the end of the
controller create method that uses attachment_fu – instead of mucking
about with attachment-fu’s lower-level plumbing?

Or does attachment_fu handle the needed garbage collection in some
other way so it’s good to go as is? In a development environment app,
the attachment_fu/RMagick stack is working great, but I’d like to
understand whether I need to do something more before moving to

Many thanks in advance for any pointers!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs