Robin Schreiber added the comment:

Updated the patch, corrected multiple syntax errors and missing INCREFS. Also 
added the comments that include the members names. I am yet undecided regarding 
the NULL-check for FindModule.

Apart from that I have tried to build some tests that prove that loading and 
unloading the module do not cause any memory leaks. This has turned up several 
problems: For one, the only possibility to check for the leaks that PEP 3121 
tries to fix, is to run PyInit of the respective module multiple times. This is 
only possible if Py_finalize() has been called after the module has been 
imported beforehand. This means we can not test for these leaks from within 
Python, but need some C-Code that calls
Py_initialize(); ... import xx ... Py_finalize(); multiple times. The problem 
is that also the plain Py_initialize(); Py_finalize(); calls leak memory. 
Unfortunately the amount of objects that are leaked also seems to vary, so 
there is no constant factor that I can subtract to determine how much the 
imported module itself leaks.
So I am kind of on a dead end here. I could upload the tests scripts that I 
have written so far, if that helps.

----------
keywords: +patch
Added file: http://bugs.python.org/file31272/xxmodule_pep3121-384_v1.patch

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

Reply via email to