RMagick 2.10.0 has experimental support for using Ruby-managed memory for all objects. In this mode Ruby can automatically garbage-collect unused images just like any other object.
To enable this support, add the line
RMAGICK_ENABLE_MANAGED_MEMORY = true
before requiring RMagick. You can programatically determine when RMagick is using Ruby memory by testing the constant
Magick::MANAGED_MEMORY
When this constant is true then RMagick is using Ruby memory.
This support is experimental. If you decide to take it out for a spin please share your experiences. Thanks!
|