[IronPython] IronPython with CherryPy through WSGI Memory issue

Can Gencer cgencer at gmail.com
Fri Apr 2 00:17:56 CEST 2010


On Thu, Apr 1, 2010 at 7:27 PM, Dino Viehland <dinov at microsoft.com> wrote:
> 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
> morning).
>
> 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.
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>

I tried this, ExceptionHelpers.DynamicStackFrames.Count seems to be
constant at 1.. I'm not very familiar with windbg but I can certainly
learn more about it.. What should I be looking for?

Thanks!

/Can



More information about the Ironpython-users mailing list