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

memory leak

by xjd925z (Initiate)
on Dec 22, 2016 at 14:03 UTC ( [id://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 (Archbishop) on Dec 22, 2016 at 14:28 UTC
Re: memory leak
by kschwab (Vicar) 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 (Archbishop) on Dec 22, 2016 at 20:14 UTC
Re: memory leak
by Marshall (Canon) 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
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1178366]
Approved by Corion
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-03-19 03:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found