Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Tool to detect potential memory leak in code

by mihirjha (Novice)
on Jan 28, 2008 at 12:32 UTC ( #664671=perlquestion: print w/ replies, xml ) Need Help??
mihirjha has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks! Do we have any tool to detect potential memory leak in perl code?The code which perl use for garbage collection can be modified a bit to detect the potential leak what do you say? regards, Mihir

Comment on Tool to detect potential memory leak in code
Re: Tool to detect potential memory leak in code
by Corion (Pope) on Jan 28, 2008 at 12:37 UTC

      According to the Wikipedia article you linked, "Reference counting is often known as a garbage collection algorithm". I've always thought of reference counting as a simple garbage collector.

      What do you consider the difference between these?

        I'll throw out my two cents worth: The term "garbage collection" implies to me that an active process (separate from the main program's flow of execution) goes over the contents of memory that've been allocated at some point (e.g. when memory is "low") and puts unused chunks back onto a free list to be handed back out. Reference counting on the other hand is part of the normal process of getting rid of a handle (when something with 0 external references is encountered it's immediately put back on the free list).

        Or maybe in "reference counting" the allocated chunks play a more active part in memory management, whereas with GC it's presumed that there's an almost external actor going through behind the scenes cleaning up after everything.

        The cake is a lie.
        The cake is a lie.
        The cake is a lie.

Re: Tool to detect potential memory leak in code
by olus (Curate) on Jan 28, 2008 at 12:49 UTC

    Using the Search on memory leak shows up a few nodes where this topic has been discussed.

    In addition to Corion's reply, you could browse those discussions and check to see if you find some similar symptoms that match your problems.

Re: Tool to detect potential memory leak in code
by jplindstrom (Monsignor) on Jan 28, 2008 at 15:26 UTC
    In additon to the modules already mentioned, there's also Devel::Leak::Object which looks promising.

    /J

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2014-08-29 13:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (280 votes), past polls