ropey has asked for the wisdom of the Perl Monks concerning the following question:
and in the startup of the Community class it doessub community { my $self = shift; $self->{'community'} = new Community($self); }
Would I be right in saying this is causing a memory leak ? I need to be able to access the methods of the session object within the community object, so is there any way of accomplishing this without causing this memory leak ? I know I need to break this circular reference but not sure how to !! I looked on Super Search and found some similar nodes memory leak however they didn't solve my problem. I guess this problem is indeed whats causing the error logs to fill up withsub new { my($class, $session) = @_ my $self = { }; bless($self, $class); $self->{'session'} = $session; }
Thanks in advanceAttempt to free unreferenced scalar !
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is this a Memory leak ?
by broquaint (Abbot) on Feb 21, 2002 at 15:07 UTC | |
|
Re: Is this a Memory leak ?
by perrin (Chancellor) on Feb 21, 2002 at 17:59 UTC | |
|
Re: Is this a Memory leak ?
by rinceWind (Monsignor) on Feb 21, 2002 at 18:04 UTC | |
|
Re: Is this a Memory leak ?
by ropey (Hermit) on Feb 22, 2002 at 09:51 UTC |