Skip Menu |

This queue is for tickets about the Moose CPAN distribution.

Report information
The Basics
Id: 52538
Status: rejected
Priority: 0/
Queue: Moose

People
Owner: Nobody in particular
Requestors: harv [...] ruin.nu
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.93
Fixed in: (no value)



Subject: Memory leak (cycle) Moose::Meta::Method::Accessor and Moose::Meta::Method::Constructor through $meta from environment
Both have '$meta' set to \$self in their environments for _compile_code, which then seems to add this variable to the closure of generated code, resulting in a cycle. This is done in: Moose::Meta::Method::Constructor::__initialize_body() Moose::Meta::Method::Accessor::_eval_code() Not sure how to weaken those references though. Cycle (1): $Class::MOP::Class::Immutable::Moose::Meta::Class::A-> {'__immutable'} => \%B $B->{'inlined_methods'} => \@C $C->[0] => \ %Moose::Meta::Method::Constructor::D $Moose::Meta::Method::Constructor::D->{'body'} => \&E $E variable $meta => \$F $$F => \ %Moose::Meta::Method::Constructor::D ----------------------------------------------------------- Cycle (1): $Class::MOP::Class::Immutable::Moose::Meta::Class::A-> {'__immutable'} => \%B $B->{'inlined_methods'} => \@C $C->[0] => \ %Moose::Meta::Method::Constructor::D $Moose::Meta::Method::Constructor::D->{'attributes'} => \@E $E->[0] => \%Moose::Meta::Attribute::F $Moose::Meta::Attribute::F->{'associated_methods'} => \@G $G->[0] => \ %Moose::Meta::Method::Accessor::H $Moose::Meta::Method::Accessor::H->{'body'} => \&I $I variable $meta => \$J $$J => \ %Moose::Meta::Method::Accessor::H
Subject: Re: [rt.cpan.org #52538] Memory leak (cycle) Moose::Meta::Method::Accessor and Moose::Meta::Method::Constructor through $meta from environment
Date: Mon, 7 Dec 2009 15:05:15 -0500
To: bug-Moose [...] rt.cpan.org
From: Stevan Little <stevan.little [...] iinteractive.com>
Michael, As mentioned in the other bug reports, a cycle does not mean a leak. Can you perhaps explain what it is your doing and why this is presenting an issue for you? Are you on IRC? It would be ideal to take the conversation into real- time. Please join us in #moose-dev on irc.perl.org. - Stevan On Dec 7, 2009, at 3:01 PM, Michael Andreen via RT wrote: Show quoted text
> Mon Dec 07 15:01:25 2009: Request 52538 was acted upon. > Transaction: Ticket created by harv > Queue: Moose > Subject: Memory leak (cycle) Moose::Meta::Method::Accessor and > Moose::Meta::Method::Constructor through $meta from environment > Broken in: 0.93 > Severity: Normal > Owner: Nobody > Requestors: harv@ruin.nu > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=52538 > > > > Both have '$meta' set to \$self in their environments for > _compile_code, which then seems to add this variable to the closure of > generated code, resulting in a cycle. This is done in: > > Moose::Meta::Method::Constructor::__initialize_body() > Moose::Meta::Method::Accessor::_eval_code() > > Not sure how to weaken those references though. > > Cycle (1): > $Class::MOP::Class::Immutable::Moose::Meta::Class::A-> > {'__immutable'} => \%B > $B->{'inlined_methods'} => \@C > $C->[0] => \ > %Moose::Meta::Method::Constructor::D > $Moose::Meta::Method::Constructor::D->{'body'} => > \&E > $E variable $meta => \$F > $$F => \ > %Moose::Meta::Method::Constructor::D > > ----------------------------------------------------------- > > Cycle (1): > $Class::MOP::Class::Immutable::Moose::Meta::Class::A-> > {'__immutable'} => \%B > $B->{'inlined_methods'} => \@C > $C->[0] => \ > %Moose::Meta::Method::Constructor::D > $Moose::Meta::Method::Constructor::D->{'attributes'} => > \@E > $E->[0] => \%Moose::Meta::Attribute::F > $Moose::Meta::Attribute::F->{'associated_methods'} => > \@G > $G->[0] => \ > %Moose::Meta::Method::Accessor::H > $Moose::Meta::Method::Accessor::H->{'body'} => > \&I > $I variable $meta => \$J > $$J => \ > %Moose::Meta::Method::Accessor::H >
RT isn't the right place for this discussion.