From: Roger Pack Date: 2008-10-23T23:30:08+09:00 Subject: Re: Memory concerns wrt garbage collection etc > doc=Hpricot.new(open("http://somewhere/")) > # a bunch of processing > doc=Hpricot.new(open("http://somewhere.else/")) > # some more processing here. > > > When does the memory from the first instance get released? As soon as > no references point to that chunk of memory or right at the end of the > scope of wherever that object was instantiated? Theoretically as soon as you redefine doc you'll no longer have any references to it so it will be collected when the GC "kicks in" or when you call GC.start--whichever comes first. GL. -=R -- Posted via http://www.ruby-forum.com/.