From: Joey Marino Date: 2008-04-02T14:11:52+09:00 Subject: Re: GC help ------=_Part_430_12155847.1207113110821 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I shouldn't have criticized ruby like that, it actually is my second favorite language right behind PHP. If I learned RoR, it might be my most favorite. It really does a good job, is easy to write, and has a lot of features. Not to mention a great community. I am just really frustrated about this stupid app that I can't get working right. I am working on a workaround since it is only going to do a major download once then update daily. Thanks for all the help though, it feels good that there is a place to turn to for help. On Sun, Mar 30, 2008 at 10:31 PM, Bill Kelly wrote: > > 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 > > > > -- Joey Marino ------=_Part_430_12155847.1207113110821--