Memory Error

Travis Oliphant olipt at mayo.edu
Thu Sep 30 16:04:08 EDT 1999


> Hi,
> 
> I'm passing fairly large arrays around (using Numeric Py)
> and I'm getting the error:
> 
>         MemoryError: can't allocate memory for array
> 
> although I have plenty of memory left on my SGI (Indigo2
> with 448 megs). Why would I be seeing this message although
> the machine hasn't even starting swapping?   Is there a default
> stack size I can adjust somehow?
> 

I don't know exactly what's happening for you here.  But, let's
investigate.

I'll assume you are using NumPy 11.

A grep through the source shows that this error is used three times in
arrayobject.c:

All three times it is used is in PyArrayFromDimsAndData when malloc fails
while trying to allocate memory for the dimensions, or the strides, or the
data from the heap.  So, I don't think it is a stack-size question unless
malloc works in an unfamiliar way on an Indigo2.

Most likely it is failing when allocating data memory based on the
dimensions variable based to the C-routine PyArrayFromDimsAndData.

To further analyze your problem, I will need to know what command you are
using to get the failure you describe since PyArrayFromDimsAndData is used
several times in the source.

Sorry I can't be of more help.

Travis
 







More information about the Python-list mailing list