in reply to Perl Process Size Limits?
If you are growing a large array, there is an algorithm for adding more elements to the array which sometimes doubles the memory used by the array. As a rule of thumb I assume that about one third of the memory in arrays is wasted.
You can fix this by pre-extending the array with an assignment statement:
This makes the length of the array 10 million without using perl's automatic array extender, so if you know how many array elements you have ahead of time, you don't have to waste the space.$#huge_array=10000000;
It should work perfectly the first time! - toma
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Perl Process Size Limits?
by geldmacher (Initiate) on Jul 11, 2001 at 18:33 UTC |