Apache Mod-Python - Commented: (MODPYTHON-172) Memory leak with

This is Interesting: Free IT Magazines  
Home > Archive > Apache Mod-Python > July 2006 > Commented: (MODPYTHON-172) Memory leak with





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Commented: (MODPYTHON-172) Memory leak with
Harold Ship (JIRA)

2006-07-06, 1:12 pm

[ http://issues.apache.org/jira/brows...action_12419534 ]

Harold Ship commented on MODPYTHON-172:
---------------------------------------

Excuse me if this is a dumb question, but I don't know anything about the Python-C interface.

Is it possible that the code in line 319 of _apachemodule.c (from 3.2.8) is the problem?

The code is:

if (key && val)
PyList_Append(pairs, Py_BuildValue("(O,O)", key, val));

Does the object returned by Py_BuildValue() need to be dereferenced? Something like:

if (key && val) {
PyObject * list_elem = Py_BuildValue("(O,O)", key, val);
if (list_elem)
PyList_Append(pairs, list_elem);
Py_XDECREF(list_elem);
}



> Memory leak with util.fieldstorage using mod_python 3.2.8 on apache 2.0.55
> --------------------------------------------------------------------------
>
> Key: MODPYTHON-172
> URL: http://issues.apache.org/jira/browse/MODPYTHON-172
> Project: mod_python
> Type: Bug


> Components: core
> Versions: 3.2.8
> Environment: Win32 XP SP1 / SP2
> Apache 2.0.55 installed from binary (.MSI)
> Python 2.4.2 or 2.4.3 installed from binary from www.python.org
> Reporter: Laurent Blanquet


>
> I encounter memory leaks [~ 16 K per request) using the configuration described below.
> =============================
> Python configuration from Httpd.conf:
> =============================
> Alias /python/ "d:/python24/B2B/"
> <Directory "d:/python24/B2B">
> AddHandler mod_python .py
> PythonHandler pyHandlerHTTP
> PythonDebug On
> </Directory>
> =============================
> Test handler - pyHandlerHTTP.py :
> =============================
> import mod_python
> from mod_python import util
> def handler(req):
> #Removing this line solves the problem.
> F=util.FieldStorage( req )
> return mod_python.apache.OK
> =============================
> HTTP Request (dump using TCPWATCH):
> =============================
> POST http://localhost:80/python/Alertes.py HTTP/1.0
> Content-Type: multipart/form-data; boundary=--------061006144341906
> Content-Length: 209
> Proxy-Connection: keep-alive
> Host: www.tx2-localhost
> Accept: text/html, */*
> User-Agent: Mozilla/3.0 (compatible; Indy Library)
> Proxy-Authorization: Basic Og==
>
> ----------061006144341906
> Content-Disposition: form-data; name="TYPE"
>
> LAST_ALERTS
> ----------061006144341906
> Content-Disposition: form-data; name="FILEAGE"
>
> 180
>
> ----------061006144341906


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com