in reply to memory leak
Besides all the other typos and anomolies in your code, the main reason your blowing your memory is because of this line:
for($i = 0; $i < $sampleSize; $i++){
At the top of the program you are making this a reference to an anonymous hash:
$sampleSize={}; # This will hold the sample size for each population
But in the for loop you are using the numeric value of that hashref as the upper bound of your loop.
As the numeric value is likely to be something like 26596960, that means that your loop is going to try and create an array of 26 million elements, which would occupy at least 600 MB, for every element in @total.
Your program code makes no sense.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: memory leak
by Juba (Initiate) on Aug 04, 2004 at 16:03 UTC | |
by BrowserUk (Patriarch) on Aug 04, 2004 at 16:13 UTC |