From: Ryan Davis Date: 2010-09-26T16:53:09+09:00 Subject: Re: how do i force ruby to release memory On Sep 25, 2010, at 22:44 , Amit Tomar wrote: > 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?? no. that's not how a GC'd environment (usually) works. You can force the GC to run by telling it to (`ri GC` for more info), but even that won't guarantee your memory gets reclaimed by the system (or at all, since ruby uses a conservative GC there is no guarantee at all), as others have said in this thread.