3

Below is a piece of code 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 $enterCount value is same whereas the $leavecount values keeps on increasing. What dose this signify? Does it represent memory leak ? What exactly does it show?

G. Cito
  • 6,210
  • 3
  • 29
  • 42
pkm
  • 2,683
  • 2
  • 29
  • 44
  • Umm ... probably? Wouldn't you have to show the rest of your code for people to definitely say one way or the other? Even if this is a pretty much a duplicate question I still think it is a good one since there's no real "canonical" answer ... but see links below. – G. Cito Nov 10 '14 at 19:48

1 Answers1

2

You could check these SO references from @ether:

jkeroes on Github has a list of resources on perl memory leaks.

Devel::Gladiator is good for getting an overview of what is going on - you could probably modify your code to fit with the POD's Synopsis example.

Community
  • 1
  • 1
G. Cito
  • 6,210
  • 3
  • 29
  • 42