use Scalar::Util qw(weaken); my $count = 3000; do { print "".(`ps -p $$ -o size=`+0)." " if ! ($count % 100); my $x = \("abcdefghijklmnopqrstuvwxyz" x 8000); my $y = $x; weaken $y; } while $count--; #### use Scalar::Util qw(weaken); my $count = 3000; do { print "".(`ps -p $$ -o size=`+0)." " if ! ($count % 100); my $x = {x=>"abcdefghijklmnopqrstuvwxyz" x 8000}; my $y = $x; weaken $y; } while $count--;