From: Michal Suchanek Date: 2008-04-02T19:02:14+09:00 Subject: Re: GC help On 31/03/2008, Tim Hunter wrote: > Joey Marino wrote: > > > 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? > > > > Many people have used Ruby for long-running tasks that use a lot of memory. > If Ruby was not collecting unused strings, don't you think somebody would > have noticed it by now? I have noticed :-> Michal