Understanding Devel :: Leak
Below is the code snippet I am using and its output.
my $handle;
my $enterCount = Devel::Leak::NoteSV($handle);
print "$date entry $enterCount";
<<<< my piece of code >>>
my $leaveCount = Devel::Leak::CheckSV($handle);
print "$date exit $leaveCount";
output:
1)
Mon 11/10 02:34:55 entry 383852
Mon 11/10 02:35:03 exit 486726
2)
Mon 11/10 04:00:31 entry 383852
Mon 11/10 04:00:39 exit 493216
3)
Mon 11/10 04:05:15 entry 383852
Mon 11/10 04:05:23 exit 493927
Every time I run my script, the value $enterCount
is the same, whereas the values $leavecount
keep increasing. What dose does this mean? Is this a memory leak? What exactly does this show?
+3
source to share
1 answer
You can check these SO @ether links :
- Finding a Perl memory leak
- Are there any tools for finding memory leaks in my Perl program?
- Common memory leak patterns / Perl references?
jkeroes on Github has a list of resources for perl memory leaks.
Devel::Gladiator
good for getting an overview of what's going on - you can probably modify your code to match the POD Synopsis example.
+2
source to share