Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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

Replies are listed 'Best First'.
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.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://664671]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2017-02-22 21:11 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (335 votes). Check out past polls.