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

DORSEY_EDMUND_K@LILLY.COM DORSEY_EDMUND_K@LILLY.COM
Tue Jul 1 10:29:02 2003


This is a multipart message in MIME format.

--Boundary_(ID_lGig0Ad/t17kN9QAmb93eA)
Content-type: text/plain; charset="us-ascii"

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


--Boundary_(ID_lGig0Ad/t17kN9QAmb93eA)--