From: Amit Tomar Date: 2010-09-26T14:44:26+09:00 Subject: Re: how do i force ruby to release memory Jes炭s Gabriel y Gal叩n wrote: > On Sat, Sep 25, 2010 at 6:41 AM, Amit Tomar > wrote: >> but Ryan how do i force it to release memory??? > Do you need the stream outside that method? If not, don't use an > instance variable, and use a local variable instead. > > def download > stream = Stream.find(params[:id]) > ... > end > > When the method finishes executing the stream variable goes out of > scope, and it's the only reference to that object, so that memory can > be freed by the GC. > > Jesus. i don't want stream outside this method. and what you want to say as soon as method finishes it automatically release memmory (since stream scope is only within the function) am i right?? -- Posted via http://www.ruby-forum.com/.