Subject: | Memory leak (cycle) Moose::Meta::Method::Delegation body member and $self |
Moose::Meta::Method::Delegation::_initialize_body creates a sub which
gets $self from closure, creating a cycle.
As far as I know it can be fixed by using Scalar::Util::weaken on $self.
Cycle (1):
$Class::MOP::Class::Immutable::Moose::Meta::Class::A->
{'methods'} => \%B
$B->{'execute'} => \
%MooseX::Method::Signatures::Meta::Method::C
$MooseX::Method::Signatures::Meta::Method::C->
{'parsed_signature'} => \%Parse::Method::Signatures::Sig::D
$Parse::Method::Signatures::Sig::D->{'_positional_params'} => \
%Parse::Method::Signatures::ParamCollection::E
$Parse::Method::Signatures::ParamCollection::E->{'params'} =>
\@F
$F->[0] => \
%Class::MOP::Class::__ANON__::SERIAL::5::G
$Class::MOP::Class::__ANON__::SERIAL::5::G->{'__MOP__'} => \
%Moose::Meta::Class::H
$Moose::Meta::Class::H->{'_meta_instance'} => \
%Moose::Meta::Instance::I
$Moose::Meta::Instance::I->{'attributes'} =>
\@J
$J->[5] => \%Moose::Meta::Attribute::K
$Moose::Meta::Attribute::K->{'associated_methods'} =>
\@L
$L->[2] => \
%Moose::Meta::Method::Delegation::M
$Moose::Meta::Method::Delegation::M->{'body'} =>
\&N
$N variable $self => \$O
$$O => \
%Moose::Meta::Method::Delegation::M