Is there no compression support for large sized strings in Python?

Claudio Grondi claudio.grondi at freenet.de
Thu Dec 1 12:06:25 EST 2005


I was also able to create a 1GB string on a different system (Linux 2.4.x,
32-bit Dual Intel Xeon, 8GB RAM, python 2.2).
$ python -c 'print len("m" * 1024*1024*1024)'
1073741824
I agree with another poster that you may be hitting Windows limitations
rather
than Python ones, but I am certainly not familiar with the details of
Windows
memory allocation.
Jeff
----------

Here my experience with hunting after the memory limit exactly the way Jeff
did it (Windows 2000, Intel Pentium4, 3GB RAM, Python 2.4.2):

\>python -c "print len('m' * 1024*1024*1024)"
1073741824

\>python -c "print len('m' * 1136*1024*1024)"
1191182336

\>python -c "print len('m' * 1236*1024*1024)"
Traceback (most recent call last):
  File "<string>", line 1, in ?
MemoryError

Anyone on a big Linux machine able to do e.g. :
  \>python -c "print len('m' * 2500*1024*1024)"
or even more without a memory error?

I suppose, that on the Dual Intel Xeon, even with 8 GByte RAM the upper
limit for available memory will be not larger than 4 GByte.
Can someone point me to an Intel compatible PC which is able to provide more
than 4 GByte RAM to Python?

Claudio






More information about the Python-list mailing list