in reply to Re^2: Why it takes so much time here?
in thread Why it takes so much time here?

My system has 7GB ... (6GB free)

On my system, creating a list of 10_000_000 scalars on Perl's stack already takes roughly 700MB. So, as you have 10 times as many, 7GB is pretty close...

Try this

$ perl -MList::MoreUtils -e'any {<>} 1..10_000_000'

and check its memory usage with top or ps (abort with ^C).