[issue10363] Embedded python, handle (memory) leak
report at bugs.python.org
Fri Oct 28 11:08:28 CEST 2011
Martin Dunschen <mdunschen at gmail.com> added the comment:
Unloading would not be necessary if the DLL is just the python interpreter,
but if you build a DLL with python embedded that does quite a bit more than
some python interpreting (in my case complex C/C++ numerical calculations)
unloading the DLL is a convenient way to free up unused resources. There are
C++ classes that extend python in my code (via swig), and that's where the
size of the DLL get's increased.
If the handle leaks are restricted to the windows implementation of cpython,
could it not be justified to allow C++ in a patch, I can't think of a C only
compiler for windows?
On Thu, Oct 27, 2011 at 11:39 PM, Antoine Pitrou <report at bugs.python.org>wrote:
> Antoine Pitrou <pitrou at free.fr> added the comment:
> Here is a patch that fixes some of these handle leaks in Python 3.2.
> However, as a general guideline, you shouldn't unload the Python DLL if you
> fish to use it later again. Just keep it in memory (the DLL isn't very big,
> is it?). Yes, C++ would allow to solve this, but the interpreter is
> currently written in C and there's no plan, even in the middle term, to
> change this.
> keywords: +patch
> nosy: +loewis
> Added file: http://bugs.python.org/file23539/freelocks.patch
> Python tracker <report at bugs.python.org>
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list