Issue Details (XML | Word | Printable)

Key: MODPYTHON-60
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Jim Gallacher
Reporter: Jim Gallacher
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
mod_python

PythonOption directive causes memory leak

Created: 23/Jun/05 11:19 PM   Updated: 05/Mar/06 02:07 PM
Return to search
Component/s: core
Affects Version/s: 3.1.3, 3.1.4, 3.2.7
Fix Version/s: 3.2.7

Time Tracking:
Not Specified

Environment: Linux

Resolution Date: 17/Sep/05 12:12 AM


 Description  « Hide
This was previously reported on the mod_python mailing list. See http://www.modpython.org/pipermail/mod_python/2004-April/015395.html

A memory leak results when there is a PythonOption directive in the apache config file. Leak occurs when PythonOption is in either <VirtualHost> or <Directory> section.

For each request, approx 25 bytes of memory is leaked per PythonOption directive.

Methodolgy (using top to gauge memory usage, 100,000 requests per test case):

def handler(req):
    req.content_type = 'text/plain'
    req.write('PythonOption test\n')
    return apache.OK

1. No PythonOption directives:
    1.4 % MEM

2. 50 PythonOption directives:
    11.3% MEM

3. 100 PythonOption directives:
     25.4 % MEM


I know 50 or 100 PythonOptions is not likely in a production system, but it clearly demonstrate the leak.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #263916 Sun Aug 28 20:39:51 UTC 2005 jgallacher Fixed crash and memory leak in python_merge_config function in mod_python.c
described in MODPYTHON-75. Boyan Boyadjiev provided the code which corrected
the problem. This also fixes the memory leak resulting in the use of any
PythonOption directive as described in MODPYTHON-60.
Files Changed
MODIFY /httpd/mod_python/trunk/src/mod_python.c
MODIFY /httpd/mod_python/trunk/src/include/mpversion.h