[python-win32] Memory leak when importing in embedded python
mani sabri
mani.sabri at gmail.com
Wed Aug 20 14:41:39 CEST 2008
Hi
Importing some modules[2] in embedded python between Py_NewInterpreter and
Py_EndInterpreter[1] cause memory leak. Not all the modules cause leaks (ex
sys module) but most of them do! And none of them cause any leak when they
are not embedded! What cause this? Is it solveable?
Best regards,
Mani Sabri
---------------------------------------------------------------------------
[1]-embedded python
for(;;)
{
PyThreadState* pInterpreter= Py_NewInterpreter();
PyObject* a = PyImport_ImportModule("clientc");
Py_EndInterpreter(pInterpreter);
}
----------------------------------------------------------------------------
[2]-some module:
#clientc.py
import pywintypes, winerror
from win32file import
CreateFile,ReadFile,WriteFile,GENERIC_READ,GENERIC_WRITE,OPEN_EXISTING
from win32pipe import
PIPE_READMODE_MESSAGE,SetNamedPipeHandleState,PeekNamedPipe
import ctypes
import cPickle
#the above imports will cause leak in embedded application!
More information about the python-win32
mailing list