[Tutor] Problems creating very large arrays (over 10 million indices)

Alan Trautman ATrautman@perryjudds.com
Tue Jul 1 10:52:01 2003


Edmund,

An array as large as you want will require quite large computing power
unless the stored data is binary.

Questions: 
What are you storing (generic description) in each array position? Large
amounts of data will require completely different structures.

What can't the image be broken up into smaller regions? This is the way
graphics are normally handled. By breaking images into squares (triangles
for 3D graphics) the computer only has to deal with smaller regions at a
time. 


If you can work on smaller regions the test will be a few choices: Sort the
incoming file, pick a regional small array and extract its' data from the
larger file, and/or take each data element as it comes and locate the
smaller array, store and move to the next element. These are a few methods I
can think of, I'm sure the list can come up with others.


HTH
Alan


I need to initialize an array with sizes greater than 10 million indices. 
The reason for this is because I then proceed to fill in the array but 
jumping around.  (The array is used to store binary medical image data)  I 
tried using a for loop like so


for i in range(0, arraySize): #arraySize being over 10 million
        myArray.append(0)       #just use zero as a place holder

WHen arraySize is small under 200,000 or so it works okay (though very 
very slow)  Anything larger than this and it just crashes.  I have 2 gigs 
of memory so I'm not running out of memory. 

Two Questions...

1)  Why does this crash?
2) Is there a faster, stable way to do what I want to do

Thank you for all the help

~Edmund Dorsey