Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: scope and undef

by atemon (Chaplain)
on Aug 28, 2007 at 09:46 UTC ( [id://635543]=note: print w/replies, xml ) Need Help??


in reply to scope and undef

Existance of a circular reference can cause this problem. i.e. even if you undef $self->{dbo}, there exist some reference to same object. So its not removed from memory.

Here is a very simple problematic case for circular reference.

foreach (1..5) { my $a; my $b; $a->{b} = $b; $b->{a} = $a; } # since both are pointing to each other they will never get coll +ected.
Please check your code for any circular reference.

you may try disconnecting the database handle just before you undef the $self->{dbo} as an immediate fix.

Cheers !

--VC



There are three sides to any argument.....
your side, my side and the right side.

Replies are listed 'Best First'.
Re^2: scope and undef (Devel::Cycle)
by lodin (Hermit) on Aug 28, 2007 at 11:13 UTC

    An aid in finding any circular references could be Devel::Cycle.

    lodin

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://635543]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-04-23 21:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found