sparky8342 has asked for the wisdom of the Perl Monks concerning the following question:
-------------
#!/usr/bin/perl
use strict;
use Devel::Leak;
my $count;
my $count2;
my $diff;
my $handle;
$count = Devel::Leak::NoteSV($handle);
my %Hash = (1 => 'a', 2 => 'b');
my $Data = {};
$Data->{'one'}->{'two'} = \%Hash;
my $Data2;
push (@{$Data2->{'one'}->{'two'}},@{$Data->{'one'}->{'two'}});
undef ($Data);
undef ($Data2);
$count2 = Devel::Leak::CheckSV($handle);
$diff = $count2 - $count;
print "Difference: $diff\n";
---------------
There is a memory leak equivalent to the size of the hash being used.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Memory Leak
by merlyn (Sage) on Sep 26, 2001 at 17:19 UTC | |
|
Re: Memory Leak
by Zaxo (Archbishop) on Sep 26, 2001 at 18:11 UTC | |
|
Re: Memory Leak
by clintp (Curate) on Sep 26, 2001 at 17:07 UTC | |
|
Re: Memory Leak
by sparky8342 (Acolyte) on Sep 26, 2001 at 17:03 UTC | |
|
Re: Memory Leak
by busunsl (Vicar) on Sep 26, 2001 at 17:17 UTC | |
|
Re: Memory Leak
by sparky8342 (Acolyte) on Sep 27, 2001 at 17:00 UTC |