From: "sean.swolfe@..." Date: 2006-02-02T21:23:18+09:00 Subject: Re: "[BUG] Segmentation fault" on import script. Hmm... Strange... I did try to run a GC.start after each pass, and I now get the following errors: ruby(13904) malloc: *** vm_allocate(size=1048576) failed (error code=3) ruby(13904) malloc: *** error: can't allocate region ruby(13904) malloc: *** set a breakpoint in szone_error to debug ../db/importer.rb:158: [BUG] Bus Error I monitored the memory size and it would fluctuate between 15MB to 90MB of Physical memory. I see the Physical memory grow and shrink mostly in the 60-70MB range, but towards the end grew to 90MB. The virtual memory on the other hand starts off at about 50MB and quickly grows to 200MB and then slowly grows to 3.51GB before the program crashes. So i can see that there is some sort of an out of memory issue. Do you believe that there might be some sort of memory leak for certain operations in RMagick, particularly ImageLists created with the copy method? I have built my copy of ImageMagick to use 8bit quantum. Most of the pictures that are imported are GIFs, and about 15-20% are animated with probably only 2 or 3 frames. Each GIF is roughly about 8-30KB's in size. And we are talking about importing nearly 10,000 GIFs. with the animated frames that's roughly about 13,000 frames. Those also then each get converted to 3 smaller images, one at 110x110, one at 91x91, and one at 50x50. I also modified things a little, and had the change_geometry method work on the frame inside copied ImageList, since each list is a deep copy, rather than resizing each off of the original, and then placing the new frames over the existing ones. This seemed to have the same results. I'm wondering if there is a way to copy the ImageList object properties, such as animation settings and such, without copying over the actual Images? I looked in the docs, but all the copy methods seemed to be deep copies. I was thinking of possibly changing my application so that it would create the smaller images from the main image the first time it is called for, and then cache them on the filesystem. But seeing the issues with RMagick running out of memory even when calling GC.start, I don't think I can reliably use this method for long running web applications. Plus I'd really like to offload all the processing at the beginning, so the webserver will do less work when serving users. Thanks for your help, Sean