[mod_python] extreme memory usage with apache2

mauchi mauchi_co at earthlink.net
Tue Sep 13 11:57:17 EDT 2005


I've noticed this behaviour as of late which causes large memory usage
in apache2, rogue threads taking up 400+ megs for each client that
eventually cause me to restart apache:

I return all html content through a python object which handles the form
data and tracks errors

#    Init object and parse form
response = webObject(req)

#    return html or xml based on form entries
req.write(response.returnSomething())

#    print debugging information
req.write(response.returnErrors())

the object has an internal array called errors where I store debugging
information from the internal functions. What I expect is 1-2 lines of
messages for each time the page is loaded which is printed at the bottom
of the page. What I find is if I keep hitting refresh, that the lines
grow each time with the previous load's messages. 50 refreshes later
I'll have 50-100 lines of debugging information. This makes me think
that the webObject is staying in memory between loads and doesn't get
destroyed until I restart apache2. This has become more of a problem as
each client page now requests frequent xml updates and the server
quickly tires out.
If anyone has a suggestion on how to either: turn off said behaviour in
mod_python, destroy objects from memory, or a clever way to flush out
all of an object's internal data between loads, I would be most happy.

Thanks to all in advance!

Mauchi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20050913/2ff0a2d0/attachment.html


More information about the Mod_python mailing list