GoCool has asked for the wisdom of the Perl Monks concerning the following question:
perl -e ' use strict; use warnings; print "\nInitial size:\n" . qx {ps -o rss $$}; { my %x = (); for (my $i = 0; $i < 100000; $i++) { $x{$i} = 1; } print "\nafter allocating a huge hash:\n" . qx {ps -o rss $$}; for my $k (keys %x) { delete $x{$k} } undef %x; print "\nafter deallocating the huge hash\n" . qx {ps -o rss $$}; } print "\nafter the huge hash goes out of scope\n" . qx {ps -o rss $$}; +'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Long running tasks, perl and garbage collection
by ikegami (Patriarch) on May 20, 2009 at 19:21 UTC | |
Re: Long running tasks, perl and garbage collection
by JavaFan (Canon) on May 20, 2009 at 19:21 UTC | |
Re: Long running tasks, perl and garbage collection
by zwon (Abbot) on May 20, 2009 at 20:07 UTC | |
Re: Long running tasks, perl and garbage collection
by Fletch (Bishop) on May 20, 2009 at 19:22 UTC | |
Re: Long running tasks, perl and garbage collection
by chromatic (Archbishop) on May 20, 2009 at 23:04 UTC | |
Re: Long running tasks, perl and garbage collection
by trwww (Priest) on May 20, 2009 at 21:28 UTC | |
Re: Long running tasks, perl and garbage collection
by grinder (Bishop) on May 21, 2009 at 14:59 UTC |