3.2.8 - Memory leaks with util.FieldStorage
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Mod-Python > 3.2.8 - Memory leaks with util.FieldStorage




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    3.2.8 - Memory leaks with util.FieldStorage  
Laurent Blanquet


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-10-06 06:11 PM

Hello,

I'm using MOD_APACHE 3.2.8 (from binary dist). with Apache 2.0.55 under Wind
ows XP Pro.
I encounter memory leaks (~ 16 Ko per request) with a very basic handler lik
e :

import mod_python
from mod_python import util

def handler(req):
F=util.FieldStorage( req )   
return mod_python.apache.OK

And sending an HTTP request like : 

====  Output from 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--
====

Has somebody encountered the same problem ?
Is there a turn-around  or a fix that can be forecasted ?

Best regards,   Laurent.





[ Post a follow-up to this message ]



    Re: 3.2.8 - Memory leaks with util.FieldStorage  
Jim Gallacher


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-11-06 12:12 AM

Laurent Blanquet wrote:
> Hello,
>
> I'm using MOD_APACHE 3.2.8 (from binary dist). with Apache 2.0.55 under Wi
ndows XP Pro.
> I encounter memory leaks (~ 16 Ko per request) with a very basic handler l
ike :
>
> import mod_python
> from mod_python import util
>
> def handler(req):
>     F=util.FieldStorage( req )
>     return mod_python.apache.OK
>
> And sending an HTTP request like :
>
> ====  Output from 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--
> ====
>
> Has somebody encountered the same problem ?
> Is there a turn-around  or a fix that can be forecasted ?

This is the first that this has been reported, so forecasting a fix is
difficult. It would be helpful if you created a JIRA issue at
http://issues.apache.org/jira/browse/MODPYTHON

util.FieldStorage is straight Python code, so I'm surprised that it
would be leaking, particularly 16K per request. Can you offer any more
details? How are you testing, other mod_python Apache directives you may
be using an so on.

It's probably best to keep this discussion on the developer's list so
that the thread doesn't get muddled.

Jim






[ Post a follow-up to this message ]



    Re: 3.2.8 - Memory leaks with util.FieldStorage  
Jim Gallacher


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-11-06 12:12 AM

Jim Gallacher wrote:
> Laurent Blanquet wrote: 
>
> This is the first that this has been reported, so forecasting a fix is
> difficult. It would be helpful if you created a JIRA issue at
> http://issues.apache.org/jira/browse/MODPYTHON
>
> util.FieldStorage is straight Python code, so I'm surprised that it
> would be leaking, particularly 16K per request. Can you offer any more
> details? How are you testing, other mod_python Apache directives you may
> be using an so on.

Laurent,

Also, could you confirm that it *is* FieldStorage that is leaking (if
you haven't already) by just reading the request body, bypassing
FieldStorage completely. eg.

import mod_python
from mod_python import util

def handler(req):
data = req.read()
return mod_python.apache.OK

Thanks,
Jim






[ Post a follow-up to this message ]



    Re: 3.2.8 - Memory leaks with util.FieldStorage  
Jim Gallacher


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-11-06 12:12 AM

Jim Gallacher wrote:
> Laurent Blanquet wrote: 
[vbcol=seagreen] 
>
> This is the first that this has been reported, so forecasting a fix is
> difficult. It would be helpful if you created a JIRA issue at
> http://issues.apache.org/jira/browse/MODPYTHON
>
> util.FieldStorage is straight Python code, so I'm surprised that it
> would be leaking, particularly 16K per request.

That was a stupid statement on my part since FieldStorage does call some
mod_python code that *is* written in C, and could very well leak.  It is
however correct to say that we have not had a leak reported against
FieldStorage in particular. There were some leaks in 3.1.4, but I
thought we caught them for the 3.2.7 release.

Back to the code.

Jim






[ Post a follow-up to this message ]



    Re: 3.2.8 - Memory leaks with util.FieldStorage  
Jim Gallacher


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-12-06 12:11 AM

Laurent,

Could you run a couple of more tests?

test1.py
--------
from mod_python import apache, util

def handler(req):
pqs = util.parse_qsl('foo=a&bar=b')
req.content_type = 'text/plain'
req.write('mod_python.util.parse_qsl')
return apache.OK

test2.py
--------
from mod_python import apache
import cgi

def handler(req):
pqs = cgi.parse_qsl('foo=a&bar=b')
req.content_type = 'text/plain'
req.write('cgi.parse_qsl')
return apache.OK


Jim







[ Post a follow-up to this message ]



    Re: 3.2.8 - Memory leaks with util.FieldStorage  
Laurent Blanquet


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-12-06 06:12 AM

Hello,

I've run the 2 tests, and I do not see any leaks.

Laurent.

> Laurent,
>
> Could you run a couple of more tests?
>
> test1.py
> --------
> from mod_python import apache, util
>
> def handler(req):
>      pqs = util.parse_qsl('foo=a&bar=b')
>      req.content_type = 'text/plain'
>      req.write('mod_python.util.parse_qsl')
>      return apache.OK
>
> test2.py
> --------
> from mod_python import apache
> import cgi
>
> def handler(req):
>      pqs = cgi.parse_qsl('foo=a&bar=b')
>      req.content_type = 'text/plain'
>      req.write('cgi.parse_qsl')
>      return apache.OK
>
>
> Jim







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:00 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register