[IronPython] Chasing memory leak in IronPython scripts

yngipy hernan yngipy at gmail.com
Fri Aug 20 06:06:42 CEST 2010


RE: Weird, is there a stack trace?
None.

RE: Could you run w/ -X:ExceptionDetail to get the C# stack trace?
Here you go...

D:\>ipy -X:MTA -X:ExceptionDetail stressopc.py
Specified cast is not valid.
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(
   at Microsoft.Scripting.ComInterop.ComRuntimeHelpers.CheckThrowExceptio
essage)
   at CallSite.Target(Closure , CallSite , Object , Object , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](Cal
   at CallSite.Target(Closure , CallSite , Object , Object , Object )
   at CallSite.Target(Closure , CallSite , CodeContext , Object , Object
   at IronPython.Compiler.Ast.CallExpression.Invoke2Instruction.Run(Inter
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame fr
   at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0
   at IronPython.Compiler.PythonCallTargets.OriginalCallTarget2(PythonFun
   at IronPython.Runtime.PythonFunction.FunctionCaller`2.Call2(CallSite s
   at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](
   at IronPython.Runtime.PythonFunction.FunctionCaller`2.Default1Call2(Ca
1)
   at CallSite.Target(Closure , CallSite , CodeContext , Object , Object
   at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](Cal
   at CallSite.Target(Closure , CallSite , CodeContext , Object , Object
   at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(Inter
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame fr
   at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
   at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)
   at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope)
   at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName)
   at IronPython.Hosting.PythonCommandLine.RunFile(String fileName)
TypeError: Specified cast is not valid.

This is where it fails:

> OPCDotNetAutomation.OPCItem.Read(self.m_opc_item,DEVICE_READ, self.val,
> self.tmp, self.tmp)


Where:
OPCDotNetAutomation is an interop namespace
OPCItem - i think this is an interface
.Read - COM method

As you may have noticed, I am using unbound class to call .Read method of
OPCItem interface(class?).

Regards,
Yngipy

On Thu, Aug 19, 2010 at 2:34 PM, Dino Viehland <dinov at microsoft.com> wrote:

>  Weird, is there a stack trace?  Could you run w/ -X:ExceptionDetail to
> get the C# stack trace?
>
>
>
> *From:* users-bounces at lists.ironpython.com [mailto:
> users-bounces at lists.ironpython.com] *On Behalf Of *yngipy hernan
> *Sent:* Thursday, August 19, 2010 3:24 AM
>
> *To:* Discussion of IronPython
> *Subject:* Re: [IronPython] Chasing memory leak in IronPython scripts
>
>
>
> Thanks for the input Dino. I will to try to track GC Heap.
>
>
>
> In the meantime, I tried -X:MTA and got this error:
>
>
>
> TypeError: Specified cast is not valid.
>
>
>
> Works fine without -X:MTA switch.
>
>
>
> -Yngipy
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100819/b2c48208/attachment.html>


More information about the Ironpython-users mailing list