From: Robert Klemme Date: 2010-09-26T20:45:20+09:00 Subject: Re: how do i force ruby to release memory On 09/26/2010 07:36 AM, Amit Tomar wrote: > Walton Hoops wrote: >> On 9/24/2010 10:41 PM, Amit Tomar wrote: >>> >>> but Ryan how do i force it to release memory??? >> You don't. You remove the reference by setting @stream=nil, and the >> Garbage Collector will release the memory when it gets around to it. >> Note there are no guarantees about when the GC will run, or what it will >> free when it does, so it's not like you will see the memory drop >> immediately when you set @stream to nil, in fact it's very likely that >> it won't get run until the interpreter tries to allocate the next chunk >> of memory for the next 1G object. > > yaa walton , i already tried with @stream=nil but i have same situation > with memory,ruby is still holding memory and also trying to use GC.start > but of no use > > What should i do now ??? Relax. Did you see NoMemoryError? If not, there's not more to do here unless you want to change the library you are using to one that uses less memory. Cheers robert