Memory Error while constructing Compound Dictionary
Phil Frost
indigo at bitglue.com
Tue Sep 7 14:12:09 EDT 2004
If you are using Linux on x86, there is a kernel configuration option
that might give more than 2GiB of address space to each process. This
will require that you compile your own kernel.
If you arn't using Linux on x86, then you are still probably hitting an
OS limitation. If you have access to an itanium, G5, or newer MIPS (SGI)
CPU, that *might* help.
If your keys are sequential integers, you will likely find numerical
python <http://numpy.sf.net> useful.
On Tue, Sep 07, 2004 at 10:47:22AM -0700, Benjamin Scott wrote:
> Hello.
>
> I attempted to build a compound dictionary:
>
> len(Lst)=1000
> len(nuerLst)=250
> len(nuestLst)=500
>
> Dict={}
>
> for s in Lst:
> Dict[s]={}
>
> for s in Lst:
> for t in nuerLst:
> Dict[s][t]={}
>
> for s in Lst:
> for t in nuerLst:
> for r in nuestLst:
> Dict[s][t][r]={}
>
>
>
> I got the following error:
>
> Traceback (most recent call last):
> File "<pyshell#89>", line 5, in -toplevel-
> Dict[s][t][r]=[]
> MemoryError
>
>
> Specs:
>
> Python 2.3.4
> XPpro
> 4 GB RAM
>
>
> Python was utilizing 2.0 GB when the error was generated. I have
> attempted this task twice with different data sets. I got the same
> error both times.
>
> Thanks in advance for your feedback,
>
> Benjamin Scott
More information about the Python-list
mailing list