[IronPython] IronPython with CherryPy through WSGI Memory issue
dinov at microsoft.com
Thu Apr 1 19:27:12 CEST 2010
Can Gencer wrote:
> I am trying to use CherryPy through IronPython. I am using a custom
> web server written in C# and I am using the NWSGI handler available
> here (http://nwsgi.codeplex.com/) with some modifications to work with
> my custom web server instead of IIS.
> Everything works after some tweaking done to CherryPy. I re-use the
> application callable that is retrieved from the main script that is
> compiled into CompiledCode . However the memory usage never seems to
> go down, and goes up with every HTTP request, even if I force
> GC.Collect() after every request.
> The WSGI handler is invoking the delegate returned from the main
> python script with some parameters that are standard in WSGI, such as
> a start_response delegate Everytime a request is made, the handler
> will invoke the application callable that is stored as a reference.
> CherryPy also has a built in web server that is using WSGI that can be
> invoked with CPython. When testing that, there are no memory leaks.
> Any ideas on what the problem could be?
The one issue that I know people have been running into is related to
exception handling leaking memory. 2.6.1 has some improvements to
prevent this from happening but it still might happen. 2.7 will have
a permanent fix for this (which is available on CodePlex in as of this
To see if this is the problem you can check ExceptionHelpers.DynamicStackFrames
and see if it's growing larger. You can set it to null if it is.
If that's not it I can give some suggestions on how to debug it but
usually involes windbg.
More information about the Ironpython-users