Jim, This are my results for the memory leak search in apache.table(). The table object creates a memory pool by using apr_pool_create_ex() and destroys the pool using apr_pool_destroy(). I added a line in MpTable_New() before "return (PyObject*)t" to destroy the pool and ran 1M iterations and I notice that there was no memory leak. Therefore the apache functions seems to be working fine. I couldn't fix the problem but here is a work around. In mod_python/util.py instead of using apache.make_table() use a regular Python dictionary. So the line that looks like: headers = apache.make_table() now looks like: headers = {} The apache table is basically used a Python dictionary. The only functionality that is lost is that apache tables are case insensitive, and that can be easily fixed by creating a class in Python that inherits from dict type and override the __getitem__ and __setitem__ methods. For the moment I'm going to keep this changes until modpython.org release a patch. I spent quite sometime trying to investigate and solve the memory leak problem but the best I was able to do was to work around it. BTW, apache.table, apache.make_table or _apache.table is only being used in mod_python/util.py. /amn On Aug 13, 2006, at 12:01 PM, Jim Gallacher (JIRA) wrote:
|
- [jira] Created: (MODPYTHON-184) Memory leak apache... Jim Gallacher (JIRA)
- [jira] Updated: (MODPYTHON-184) Memory leak a... Jim Gallacher (JIRA)
- Re: [jira] Created: (MODPYTHON-184) Memory le... Alexis Marrero
- Re: [jira] Created: (MODPYTHON-184) Memor... Jim Gallacher
- Re: [jira] Created: (MODPYTHON-184) Memor... Jim Gallacher
- Re: [jira] Created: (MODPYTHON-184) M... Justin Erenkrantz
- [jira] Commented: (MODPYTHON-184) Memory leak... Graham Dumpleton (JIRA)
- [jira] Updated: (MODPYTHON-184) Memory leak a... Graham Dumpleton (JIRA)
- [jira] Updated: (MODPYTHON-184) Memory leak a... Graham Dumpleton (JIRA)
- Re: [jira] Updated: (MODPYTHON-184) Memor... Jim Gallacher
- [jira] Commented: (MODPYTHON-184) Memory leak... Jim Gallacher (JIRA)
- [jira] Resolved: (MODPYTHON-184) Memory leak ... Graham Dumpleton (JIRA)
- [jira] Commented: (MODPYTHON-184) Memory leak... Alexis Marrero (JIRA)