Topic: How to close an RMagick image file

Hey,

I've looked through the documentation on how to close a file after loading it like so:

img = Magick::Image.read(x).first

and can't find anything.

But how do you make sure to clean it up later? Just doing the following:

img = nil

doesn't work. It just keeps on eating away at my virutal memory. Keep in mind, I'm trying to sort through over 1000 image files, looking at their EXIF info, and then do some processing based on the EXIF info.

Thanks.

Re: How to close an RMagick image file

I had to end up breaking my script at 100 files to allow Fedora to clear out memory. Although this was a pain, it significantly reduced the time needed to process thousands of images.