------=_Part_14248_21699125.1175022088823
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

So my first question is this: why are you doing this? Ruby's garbage
collector is perfectly capable of finding and preventing REAL memory leaks.

What you have here is not a memory leak detector, but an "objects have been
created" detector. "hello" is then obviously caught as a new object created,
and as Ruby returns the result of the last statement of a method, it is not
yet out of scope until the program quits, in your case.

Jason

On 3/27/07, Pratik <pratiknaik / gmail.com> wrote:
>
> Hi,
>
> I'm trying to write a code that'd inspect my method calls for any
> memory leaks. You can find my code at http://pastie.caboo.se/49859
>
> In my method, I have
>
> def leaker
>     "hello"
> end
>
> Here, as per my code, the string "hello" is caught as a leak. Could
> someone tell me if I'm doing it the right way ?
>
> Thanks,
> Pratik
>
>

------=_Part_14248_21699125.1175022088823--