[issue10156] Memory leak (r70459)

Marc-Andre Lemburg report at bugs.python.org
Thu Oct 21 00:29:41 CEST 2010


Marc-Andre Lemburg <mal at egenix.com> added the comment:

Stefan Krah wrote:
> 
> Stefan Krah <stefan-usenet at bytereef.org> added the comment:
> 
> To add to the mystery, the leak disappears if the key value is not
> interned in PyDict_SetItemString:

I'm not sure how you determine what is a leak and what not.
Interned Unicode objects stay alive until the interpreter
is finalized.

Are you suggesting that the finalization does not free the
interned Unicode strings or not all of them ?

> Index: Objects/dictobject.c
> ===================================================================
> --- Objects/dictobject.c        (revision 70459)
> +++ Objects/dictobject.c        (working copy)
> @@ -2088,7 +2088,6 @@
>         kv = PyUnicode_FromString(key);
>         if (kv == NULL)
>                 return -1;
> -       PyUnicode_InternInPlace(&kv); /* XXX Should we really? */
>         err = PyDict_SetItem(v, kv, item);
>         Py_DECREF(kv);
>         return err;

----------
nosy: +lemburg

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


More information about the Python-bugs-list mailing list