my @lines; $#lines = 12_000_000; @lines = (); <------ was missing push @lines, $_ while <IN>;
$ perl -e'print "abcdef\n" for 1..11_000_000' | perl -E' $#a=11_000_000; @a=(); push @a, $_ while <>; say int(`ps --no-heading -o vsz $$`/1000) ' 480
480MB for 77MB file with 11 million lines.
In reply to Re^3: mem usage
by ikegami
in thread mem usage
by halfcountplus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |