[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>
    >>> len(a)

If we'll take summary keys length:

    >>> log(sum(xrange(64036)), 2)

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:


And dictionary length something like:

    >>> len(a)

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>

More information about the New-bugs-announce mailing list