Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

memory leak

by xjd925z (Initiate)
on Dec 22, 2016 at 14:03 UTC ( #1178366=perlquestion: print w/replies, xml ) Need Help??
xjd925z has asked for the wisdom of the Perl Monks concerning the following question:

How do you debug a script that - you've been told - is causing memory leaks?

Replies are listed 'Best First'.
Re: memory leak
by Athanasius (Chancellor) on Dec 22, 2016 at 14:28 UTC
Re: memory leak
by kschwab (Priest) on Dec 22, 2016 at 14:09 UTC

    Devel::Size might be useful, especially if you have some idea which variables/objects/data structures might be suspect.

    Do you know why you've been told it's leaking? Assuming this is on a unix/linux box, can you try "top -p your_process_pid" and see if the VIRT figure grows in an unbounded way over time?

    Edit: Didn't find it earlier, due to the odd name, but Devel::Gladiator looks promising. It walks everything, and gives an example of how to spot new entries.
Re: memory leak
by eyepopslikeamosquito (Chancellor) on Dec 22, 2016 at 20:14 UTC
Re: memory leak
by Marshall (Abbot) on Dec 22, 2016 at 22:31 UTC
    How do you debug a script that - you've been told - is causing memory leaks?

    A very important step in this is reproducing the problem. If this is a good defect (bug) report, then it will explain in detail what the user did to cause the problem and what they did to measure the problem.

    Your first step is to make what the user saw happen, happen for you on your test system. Then once you can make it happen, try to make as short a case as possible that will make the problem happen as frequently as possible and as easily as possible.

    I have worked on some problem reports full-time for a week to make the problem report into something that the Developer cannot ignore...Run program A and this causes problem X, measured by metric Y. Repeatability is a key step to figuring out a solution.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1178366]
Approved by Corion
Front-paged by Corion
help
Chatterbox?
[Discipulus]: śledzie!! the only sweet my father in law eat

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2017-11-21 11:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (297 votes). Check out past polls.

    Notices?