Can anyone help explain why PERL gives such a large memory
footprint & advise how to get around it.

Running the simple script below, I get a footprint of 63 MB
about 22 bytes per int.

The C program only 11748 K ... 4 bytes per int


#!/usr/local/bin/perl
for ( $i=0 ; $i< 3000000 ; $i++ )
{
        $X[$i]=int(1);
}


main()
{
        int x[3000000];
        sleep(60);
}

I guess I'm paying the price for PERL not being strongly typed,
a feature I really like ( until now ;-) )

I require a large array of ints in a real application, just stripped
problem down to bear bones for demo.

I'd be grateful for any advice

Thanks in Advance
Dave


Reply via email to