From: Bill Kelly Date: 2008-03-31T11:31:09+09:00 Subject: Re: GC help From: "Joey Marino" > > I found out it is not the 3rd party code. I am downloading images (~320,000 > ct.) as strings, and saving each to a file. The file handlers are getting > closed. Using the Dike gem, I think I determined the bulk of the leaked > memory is in these string variables. But what I don't understand is that the > variables containing the strings are local to a method of an object and > should be unreferenced when that method is done, right? I've invoked GC at > the end of the method and after each iteration that the method gets called. > I've even set the strings to nil after they've been saved to a file and > before gc is called. The app is using 2G of ram and 4G of swap before it > runs of out memory and crashes about 1/3rd of the way through. I'm really > starting to doubt Ruby's ability to do memory intensive work. Any ideas? Do you have a small bit of code that reproduces the problem? How are you downloading the images? Net::HTTP ? Or...? If you can provide a small program that exhibits the memory leak I'm sure others here would be happy to try it on their systems as well. Regards, Bill