New submission from jason kirtland <j...@discorporate.us>:

Circular graphs of collections.OrderedDict are uncollectable due to the 
presence of OrderedDict.__del__.

>>> from collections import OrderedDict
>>> import gc
>>> left, right = OrderedDict(), OrderedDict()
>>> left['other'] = right
>>> right['other'] = left
>>> assert not gc.garbage
>>> del left, right
>>> gc.collect()
10
>>> assert not gc.garbage
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AssertionError

Not an issue in 3.1.1, have not verified with 3.1.2.

----------
components: Library (Lib)
files: odicttest.py
messages: 116036
nosy: jek
priority: normal
severity: normal
status: open
title: OrderedDict ref cycles cause memory leak
type: resource usage
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file18834/odicttest.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9825>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to