Excerpts from Ovid's message of Thu Jan 21 03:55:39 -0500 2010:
> Our actual application has some of those refcounts in the thousands (it gets
> fun when I throw Catalyst and DBIx::Class into the mix).  Am I just
> misunderstanding this output or does Moose leak and Class::MOP leak?  (I'm
> suspicious because it shows that Baz still has a refcount of one).

It looks like you're misusing Devel::LeakGuard::Object::State; it says you need
to call ->done() "at the end of the area to be leak-checked".

I don't know what it does if you never call ->done().

If I put a bare block around your objects, it does what I expect:

    {
        my $foo = Foo->new;
        $foo->me($foo);
        my $bar = Bar->new;
        $bar->me($bar);
        my $baz = Baz->new;
    }

    $leakstate->done;

(Baz no longer shows up.)

Anyway, the answer is "you are misunderstanding the output"; there are a ton of
references to metaobjects because the metaclass objects are still around and
referring to them, just as they should be.

Moose and CMOP may leak, but this doesn't prove anything one way or another.

hdp.

Reply via email to