MemoryError, can I use more?

Benjamin Kaplan benjamin.kaplan at
Sat Feb 13 02:14:46 CET 2010

On Fri, Feb 12, 2010 at 7:21 PM, Echavarria Gregory, Maria Angelica
<m.echavarriagregory at> wrote:
> Dear group:
> I am developing a program using Python 2.5.4 in windows 32 OS. The amount of data it works with is huge. I have managed to keep memory footprint low, but have found that, independent of the physical RAM of the machine, python always gives the MemoryError message when it has occupied exactly only 2.2 GB. I have tested this in 4 different machines, all with memory of 3 to 4 GB... I'm amazed.
> Could any of you please help me to figure out how to change that limit? I typed help(MemoryError) and it is a class itself, but that help told me nothing I can use...
> Thanks,
> Angelica.

There's nothing you can do in Python to fix it. A MemoryError means
that Python asked the OS to malloc something and it refused to give it
any more memory. In this case, it's because Windows will only allocate
2GB of RAM to a single process. There is a way to extend that to 3GB,
but I don't quite understand how to do it- something about setting
linker flags. Easiest way to handle this would be to switch to a
64-bit Python on a 64-bit platform. That way, you can use up to 8TB of

> --

More information about the Python-list mailing list