Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Re: Depth First Search through Digraph Results in Memory Leak

by djantzen (Priest)
on Jan 08, 2004 at 20:40 UTC ( #319944=note: print w/replies, xml ) Need Help??


in reply to Re: Depth First Search through Digraph Results in Memory Leak
in thread Depth First Search through Digraph Results in Memory Leak

Well I'll be damned, that fixes it. I've changed $nodes = '' to undef $nodes with the same results. So for some reason perl needs to be told to destroy the array when it should take a cue from the lexical going out of scope. I'll prepare a bug report after I stop sighing in relief. Thank you Hofmator!


"The dead do not recognize context" -- Kai, Lexx

Replies are listed 'Best First'.
Re: Re: Re: Depth First Search through Digraph Results in Memory Leak
by diotalevi (Canon) on Jan 08, 2004 at 22:49 UTC

    Change those print calls to warn(). I'm guessing that those arrays are kept around because the closures were kept around and that both were eventually cleaned up during global destruction. You are always free to clear a variable with prejudice - use undef as a function. undef $nodes might give you some different results. (you already did that. Whoops).

    That may still be a bug though but whether it is in the reference counting of $nodes' array or $sub's clusure I don't know. But then it isn't clear to me that it is a bug.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2020-05-30 05:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (171 votes). Check out past polls.

    Notices?