[New-bugs-announce] [issue19246] GC does not really free up memory in console

Пётр Дёмин report at bugs.python.org
Sun Oct 13 14:00:01 CEST 2013


New submission from Пётр Дёмин:

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

----------
components: Windows
messages: 199698
nosy: Пётр.Дёмин
priority: normal
severity: normal
status: open
title: GC does not really free up memory in console
type: resource usage
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19246>
_______________________________________


More information about the New-bugs-announce mailing list