Safe to call Py_Initialize() frequently?
Graham.Dumpleton at gmail.com
Sun Mar 29 22:00:16 CEST 2009
On Mar 30, 4:35 am, a... at pythoncraft.com (Aahz) wrote:
> In article <e97efd52-4868-47a5-91ec-657bba5f0... at z16g2000prd.googlegroups.com>,
> Graham Dumpleton <Graham.Dumple... at gmail.com> wrote:
> >In mod_wsgi however, Apache will completely unload the mod_wsgi module
> >on a restart. This would also mean that the Python library is also
> >unloaded from memory. When it reloads both, the global static
> >variables where information was left behind have been lost and nulled
> >out. Thus Python when initialised again, will recreate the data it
> >So, for case where Python library unloaded, looks like may well suffer
> >a memory leak regardless.
> >As to third party C extension modules, they aren't really an issue,
> >because all that is done in Apache parent process is Py_Initialize()
> >and Py_Finalize() and nothing else really. Just done to get
> >interpreter setup before forking child processes.
> >There is more detail on this analysis in that thread on mod_wsgi list
> Missing reference?
It was in an earlier post. Yes I knew I forget to add it again, but
figured people would read the whole thread.
More information about the Python-list