<?xml version="1.0" encoding="windows-1252"?>
<node id="1001197" title="Re^4: How can I free the memory of a XML::Simple-Object" created="2012-10-27 08:34:02" updated="2012-10-27 08:34:02">
<type id="11">
note</type>
<author id="938090">
Bauldric</author>
<data>
<field name="doctext">
You are really great :-)

By the way. Do you know a good Package for searching
memory leaks under Windows XP and perl version 5.8.8.

I have memory problems, although I use allways 
strict.pm (working only with local vars 'me $var') and have no global vars. 

The program has about 40000 Lines in 100 packages.

I would like to have something like the symdump does
to produce a list of all variables whose  
size has changed or are new allocated between two program-positions:

&lt;code&gt;
   my $memdump = MemoryDump-&gt;new();

   anyFunction();

   print $memdump-&gt;diff(MemoryDump-&gt;new();
&lt;/code&gt;

&lt;p&gt;
Exist something like that for ActiveState-Perl?
&lt;/p&gt;


 

&lt;p&gt;
For your example which you've wrote for me:
So if I set the size of the array @a 
&lt;/p&gt;

&lt;code&gt;

my @a = ();

$#a = 1e6;

&lt;/code&gt;

&lt;p&gt;
the memory will be used again
&lt;/p&gt;

&lt;code&gt;

my @a = ();

$#a = 1e6;

mem(1);

$a[ $_ ] = $_ for 1 .. 1e6;

mem(2);

undef @a;

mem(3);

my @a = ();
$#a = 1e6;

$a[ $_ ] = $_ for 1 .. 1e6;

mem(4);

sub mem {
    my $mem = `tasklist /nh /fi "PID eq $$"`;
    $mem =~ tr[ \t\n][   ]s;
    print "$mem : $_[0]\n";
};

&lt;/code&gt;
</field>
<field name="root_node">
1001135</field>
<field name="parent_node">
1001194</field>
</data>
</node>
