[IronPython] Chasing memory leak in IronPython scripts

Dino Viehland dinov at microsoft.com
Wed Aug 18 18:23:52 CEST 2010

Also you might want to compare private bytes vs. the size of the GC heap
(in perfmon) to get an idea if it's an unmanaged or managed leak given 
this is involving interop.  

One possibility is also that the finalizer thread is being blocked from
cleaning up STA COM objects.  You could try running IronPython w/ the 
-X:MTA option if you haven't as this frequently solves that problem.

> -----Original Message-----
> From: users-bounces at lists.ironpython.com [mailto:users-
> bounces at lists.ironpython.com] On Behalf Of Lukas Cenovsky
> Sent: Tuesday, August 17, 2010 11:28 PM
> To: Discussion of IronPython
> Subject: Re: [IronPython] Chasing memory leak in IronPython scripts
>   On 18.8.2010 7:25, yngipy hernan wrote:
> > Hi All,
> >
> > I have an IronPython script that is using/talking to COM server. I am
> > not sure if I have a memory leak but the IronPython Private Byte keeps
> > on growing. I haven't seen it run of memory but I might be leaking memory.
> >
> > Essential I am using an interop dll to connect to the COM server. Call
> > some methods and disconnects. I have created another script to stress
> > test this "library" to basically connect to COM server. Then
> > repeatedly create COM objects, call methods, do intermediate cleanup
> > by calling Marshal.ReleaseComObject. This part seems like leaking memory.
> >
> > Now my question is:
> > - Can anyone point me to a tutorial on detecting memory leak in
> > IronPython?
> > - Do we have tools that can help me in detecting any dangling objects?
> WinDbg is you friend for your problem. Check this blog:
> http://blog.kamil.dworakowski.name/2008/02/debugging-memory-problems-in-
> ironpython.html
> --
> -- Lukáš
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

More information about the Ironpython-users mailing list