Why is a perl script 'sleep 100' uses 100 MEGS of RAM



I have a Fedora 8 Linux box with 64 bit OS and stock perl.

Just invoking perl executable seems to take 100 MEGS of virtual memory!

That's a huge amount. Here's proof:

work$ perl -e 'sleep 10' & sleep 1; ps -eo pid,vsz,rsz,args|grep perl |grep 'sleep 10'
[3] 15023
15023 98892 1404 perl -e sleep 10
^^^^^^^ virtual memory use

My question is, WTF is going on, why does it need so much memory all of a sudden.

For your information, on my home 32 bit linux box running Fedora 6, it uses 3 megs of VM:

home$
perl -e 'sleep 10' & sleep 1; ps -eo pid,vsz,rsz,args|grep perl |grep 'sleep 10'
[1] 27037
27037 3744 1236 perl -e sleep 10

i
.



Relevant Pages