[IronPython] IronPython with CherryPy through WSGI Memory issue

Can Gencer cgencer at gmail.com
Thu Apr 8 10:41:30 PDT 2010

On Thu, Apr 8, 2010 at 7:32 PM, Jeff Hardy <jdhardy at gmail.com> wrote:
> On Thu, Apr 8, 2010 at 10:38 AM, Can Gencer <cgencer at gmail.com> wrote:
>> I've noticed there was a leak in the NWSGI implementation regarding
>> the input/output streams, i.e. they were never GC'd. It could be due
>> to the way the stream -> file conversion is done.
> Wouldn't surprise me; that's kind of an ugly piece of code. There's a
> few spots where NWSGI doesn't interact with CodeContexts correctly,
> because there wasn't really a good story around them - now I'd just
> use SharedContext, assuming I can *find* it again :).
> But there must be something else, in NWSGI or IronPython, to account
> for 35k/request.

I did my debugging like this..

I set up a url such as http://server/gc where if you would go there it
would call GC.Collect() and GC.WaitForPendingFinalizers() a few times

Then did a few requests, and call the GC url and use windbg with
!dumpheap -stat and write down the number and size of the largest
objects. Do a few more requests, call the GC url again and use windbg
again with the stat, and then use !dumpheap -mt to get all instances
of the type that is growing in size most, and then randomly call
!gcroot on some to find where the reference is being held.


More information about the Users mailing list