All:  Never mind!  The file I was attempting to read was part of an (apparently) silently incomplete download, and as such, the file size didn't match the metadata in the header file describing the data file, and I was reading beyond the end of the file.

I would submit that MemoryError is perhaps a little misleading for this particular case, but oh well.

Thanks for the comments!


On May 21, 2009, at 11:46 AM, Charles R Harris wrote:

On Thu, May 21, 2009 at 10:31 AM, Michael Hearne <> wrote:
I am getting a MemoryError from a numpy.fromfile() call in an
application I am trying to deploy.  Normally I would assume that this
would mean that I don't have enough memory available on the system.
However, if I run vmstat (Linux) at the same time as my process, I see
that I have 3+ Gigabytes of memory free, and no swap space being
used.  I can't think of a way to track down this problem, so I'm
punting to the list.  The only thing I can imagine is that someone
Python has been allocated X amount of space (very small relative to
the memory actually available), and is asking for more than X.  I
don't know if this is true, or if there is even a way to check it.

Version info:
Linux RedHat 5 kernel 2.6.18-128.1.10.el5PAE
Python 2.5.4 -- EPD_Py25 4.3.0
numpy 1.3.0

Can anyone suggest more tests that I can do?

How big is the file and what type are you importing to?


Numpy-discussion mailing list