in reply to Re^3: How can I free the memory of a XML::Simple-Object
in thread How can I free the memory of a XML::Simple-Object
my $memdump = MemoryDump->new(); anyFunction(); print $memdump->diff(MemoryDump->new();
Exist something like that for ActiveState-Perl?
For your example which you've wrote for me: So if I set the size of the array @a
my @a = (); $#a = 1e6;
the memory will be used again
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"; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: How can I free the memory of a XML::Simple-Object
by BrowserUk (Patriarch) on Oct 27, 2012 at 13:35 UTC | |
by bulk88 (Priest) on Oct 27, 2012 at 18:43 UTC | |
by BrowserUk (Patriarch) on Oct 27, 2012 at 19:43 UTC |