[mod_python] Re: mod_python 3.3.1 memory leak?

yubing trueice at gmail.com
Tue Jul 3 03:17:55 EDT 2007


It seems the memory usage still keeps going up :P

And if I run the test program in command line (without mod_python, just pump
the stream to a local file), the memory usage doesn't grow :)


On 7/3/07, Graham Dumpleton <graham.dumpleton at gmail.com> wrote:
>
> Hmm, that will not actually work as mod_python doesn't make the
> attribute writable like it should.
>
> May have to set it off for whole server by setting in Apache
> configuration:
>
>   KeepAlive Off
>
> Graham
>
> On 03/07/07, Graham Dumpleton <graham.dumpleton at gmail.com> wrote:
> > To turn off keep alive and thus chunked output, try:
> >
> >   req.connection.keepalive = apache.AP_CONN_CLOSE
> >
> > before you start writing any response data.
> >
> > Graham
> >
> > On 03/07/07, yubing <trueice at gmail.com> wrote:
> > > I've observed that, Apache will automatically convert the
> transfer-encoding
> > > to chunked upon a HTTP/1.1 response without content-length specified.
> Is
> > > there any known memory issue with chunked-encoding?
> > >
> > > thanks a lot~
> > >
> > >
> > >
> > > On 7/3/07, yubing <trueice at gmail.com> wrote:
> > > > Our project has a live HTTP video streamer written in python, which
> keeps
> > > pumping a stream out to the client.
> > > > The HTTP serving module is a simple mod_python request handler
> running on
> > > Apache 2.2.4 with mod_python 3.3.1 (Python 2.5.1).
> > > > The stream is read out of our streaming server via TCP socket, and
> the
> > > python script just do some simple processing like header building,
> each
> > > allocated buffer is del-ed after being used.
> > > >
> > > > The problem is:
> > > > We observed that after its running serveral hours, its memory
> occupation
> > > grows up to serveral hundreds of megabytes and keeps growing in 4k-8k
> > > increment every 1-2 seconds.
> > > >
> > > > Below is a simple testing scriptlet, the memory leaking issue is not
> so
> > > serious as our live serving module, but you can still observe 4k
> memory
> > > growing every serveral seconds.
> > > >
> > > > Could anyone help me to figure out the root cause of this issue?
> > > >
> > > > --------------------------
> > > > import time
> > > >
> > > > def pump_file(req):
> > > >     while(True):
> > > >         fp = open("/dev/zero", "r")
> > > >         buf = fp.read(4096)
> > > >         try:
> > > >             req.write(buf)
> > > >             del buf
> > > >             time.sleep(0.1)
> > > >         except:
> > > >             fp.close()
> > > >             break
> > > >
> > > > ---------------------------------------
> > > >
> > > >
> > > > --
> > > > truly yours
> > > > ice
> > >
> > >
> > >
> > > --
> > > truly yours
> > > ice
> > > _______________________________________________
> > > Mod_python mailing list
> > > Mod_python at modpython.org
> > > http://mailman.modpython.org/mailman/listinfo/mod_python
> > >
> > >
> >
>



-- 
truly yours
ice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20070703/64a0bef9/attachment-0001.html


More information about the Mod_python mailing list