[Catalyst-dev] Need help debugging Text::ASCIITable
Andy Grundman
andy at hybridized.org
Mon Sep 26 17:12:38 CEST 2005
Perrin Harkins wrote:
> Andy Grundman wrote:
>
>> I've been trying to fix the leak in T::A but I'm totally stumped, and
>> so is the author. If anyone wants to take a crack at it, I've
>> attached my test script.
>
>
> The way you're testing this looks a little suspect to me. First, Perl
> doesn't take more memory every time you use a new variable. Memory is
> allocated in chunks, so it's hard to predict when the next chunk will be
> grabbed.
>
> Also, memory is not reclaimed from lexical variables when they go out of
> scope. Perl keeps that memory allocated to $x AFTER it goes out of
> scope as an optimization. You have to explicitly undef it to prevent
> this. Now, $x is just a single blessed reference here, but keep it in
> mind.
Yeah you're probably right that my test sucks, but there is definitely a
memory leak in there. :) If you have a better test (preferably not
using GTop) I'd love to see it.
-Andy
More information about the Catalyst-dev
mailing list