[Twisted-web] Memory leak with twisted web server on QNX

denis.leborgne at rieter.com denis.leborgne at rieter.com
Wed Oct 19 02:15:24 MDT 2005


Hi,

I use twisted as a very simple web server to serve python scripts. I now 
have a problem of memory leak on the server. I use Python 2.2.1 on QNX 
6.3, Twisted version is 1.3.0. 
I made the following test scripts :

Web server

from twisted.web import server, resource,static,script
from twisted.internet import reactor

root = static.File("site")
root.processors = {'.py': script.PythonScript,
                 '.rpy': script.ResourceScript}

site = server.Site(root)
reactor.listenTCP(8500, site)
reactor.run()

Test script (.rpy file)

from twisted.web import resource

class Test(resource.Resource):
    isLeaf = True

    def render_GET(self, request):
        return """<html>
                    <head>
                        <meta http-equiv="refresh" content="5">
                    </head>
                    Hello, world!</html>"""

resource = Test()



About every 4 "refresh", the memory used by my server increases by 96k, 
with nor release of memory. I checked the object number by watching 
len(gc.get_objects()), but it is stable. 
Any idea to help me to solve this problem, my server is expected to run 
continuously.

Thanks.

Denis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-web/attachments/20051019/dd783fa3/attachment.htm


More information about the Twisted-web mailing list