PyApache memory leak?

Oleg Broytmann phd at phd.russ.ru
Fri Apr 21 11:52:08 EDT 2000


On Fri, 21 Apr 2000, Patrick Phalen wrote:
> [Oleg Broytmann, on Fri, 21 Apr 2000]
> :: I don't see how httpdapy could help spawn less interpreters instances -
> :: it is Apache job to fork and reap off children.
> 
> A clarification, from the Httpdapy README:
> 
> """
> 2. PyApache creates a sub-interpreter (Py_NewInterpreter()) for every
> request and destroys it when done. This means that if your script
> begins with "import HTMLgen", HTMLgen is imported (bytecode read from
> file) for every hit.
> 
> Httpdapy keeps the interpreter around from the first hit and until the
> process dies. So only the first hit will actually read HTMLgen.py(c),
> all the subsequent won't.
> """

   This don't help saving memory. Other way round - PyApache destroys
subinterpreter after processing a request, thus saving memory; but httpdapy
keeps the interpreter with all (unneccessary and superfluos) imported
modules, thus leaking memory.
   At least this is how I understand the situation. Not that I'm saying
PyApache is "best" and httpdaoy is "worst" - both are great products, and I
am happy they are there.

Oleg.            (All opinions are mine and not of my employer)
---- 
    Oleg Broytmann      Foundation for Effective Policies      phd at phd.russ.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list