Topic: How to close an RMagick image file


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

img =

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.


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.