[Python-Dev] Discussion related to memory leaks requested (original) (raw)
Benjamin Peterson benjamin at python.org
Thu Jan 14 00:42:24 EST 2016
- Previous message (by thread): [Python-Dev] Discussion related to memory leaks requested
- Next message (by thread): [Python-Dev] Discussion related to memory leaks requested
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
This is a "well-known" issue. Parts of the interpreter (and especially, extension modules) cheerfully stash objects in global variables with no way to clean them up. Fixing this is a large project, which probably involves implementing PEP 489.
On Wed, Jan 13, 2016, at 11:32, Matthew Paulson wrote:
Hi:
I've spent some time performing memory leak analysis while using Python in an embedded configuration. The pattern is: PyInitialize(); ... run empty python source file ... PyFinalize();
I've identified several suspect areas including dictionary maitenace in import.c:~ 414 /* Clear the modules dict. */ PyDictClear(modules); /* Restore the original builtins dict, to ensure that any user data gets cleared. */ dict = PyDictCopy(interp->builtins); if (dict == NULL) PyErrClear(); PyDictClear(interp->builtins); if (PyDictUpdate(interp->builtins, interp->builtinscopy)) PyErrClear(); PyXDECREF(dict); /* Clear module dict copies stored in the interpreter state */ Is there someone in the group that would like to discuss this topic. There seems to be other leaks as well. I'm new to Python-dev, but willing to help or work with someone who is more familiar with these areas than I. Thanks, Matt --
Python-Dev mailing list Python-Dev at python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/benjamin%40python.org Email had 1 attachment: + MattSig.JPG 52k (image/jpeg)
- Previous message (by thread): [Python-Dev] Discussion related to memory leaks requested
- Next message (by thread): [Python-Dev] Discussion related to memory leaks requested
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]