Message199698
Taken from http://stackoverflow.com/a/19287553/135079
When I consume all memory:
Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> a = {}
>>> for k in xrange(1000000): a['a' * k] = k
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
MemoryError
>>> len(a)
64036
If we'll take summary keys length:
>>> log(sum(xrange(64036)), 2)
30.93316861532543
we'll get near 32-bit integer overflow. After that done,
>>> a = {}
will free all 2 Gb of allocated memory (as shown in Task Manager), but executing:
>>> for k in xrange(1000000): a[k] = k
Will cause:
MemoryError
And dictionary length something like:
>>> len(a)
87382 |
|
Date |
User |
Action |
Args |
2013-10-13 12:00:01 | Пётр.Дёмин | set | recipients:
+ Пётр.Дёмин |
2013-10-13 12:00:01 | Пётр.Дёмин | set | messageid: <1381665601.5.0.467418586985.issue19246@psf.upfronthosting.co.za> |
2013-10-13 12:00:01 | Пётр.Дёмин | link | issue19246 messages |
2013-10-13 12:00:01 | Пётр.Дёмин | create | |
|