perl -wle 'system("ps uch $$");@x=1..1_000_000;print "Elements in \@x: " . @x;; system("ps uch $$");' xxx 2395 0.0 1.0 46488 44384 pts/0 R+ 18:46 0:00 perl Elements in @x: 1000000 xxx 2395 0.0 1.5 66104 64012 pts/0 R+ 18:46 0:00 perl