This project has moved and is read-only. For the latest updates, please go here.
1
Vote

OutOfMemoryException

description

Using the Python package called "requests" from IronPython.
If you have continued during this process for some time , increased usage of memory gradually , finally "OutOfMemoryException" will occur .

Please tell me the remedy to this phenomenon .

Version of IronPython in 2.7.5 , we are using IronPython from C #.
Stack trace of the log at that time is as follows .
System.Reflection.TargetInvocationException: Throw Exception ---> System.OutOfMemoryException: 
   > Microsoft.Scripting.Runtime.LightExceptions.CheckAndThrow(Object value)
   > Microsoft.Scripting.Interpreter.FuncCallInstruction`2.Run(InterpretedFrame frame)
   > Microsoft.Scripting.Interpreter.Interpreter.HandleException(InterpretedFrame frame, Exception exception)
   > Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   > Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
   > IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)
   > IronPython.Compiler.RuntimeScriptCode.Run(Scope scope)
   > IronPython.Runtime.PythonContext.InitializeModule(String fileName, ModuleContext moduleContext, ScriptCode scriptCode, ModuleOptions options)
   > IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options, ScriptCode& scriptCode)
   > IronPython.Runtime.Importer.LoadModuleFromSource(CodeContext context, String name, String path)
   > IronPython.Runtime.Importer.LoadPackageFromSource(CodeContext context, String name, String path)
   > IronPython.Runtime.Importer.LoadFromDisk(CodeContext context, String name, String fullName, String str)
   > IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, String name, String fullName, List path, Func`5 defaultLoader)
   > IronPython.Runtime.Importer.ImportFromPath(CodeContext context, String name, String fullName, List path)
   > IronPython.Runtime.Importer.ImportTopAbsolute(CodeContext context, String name)
   > IronPython.Runtime.Importer.ImportModule(CodeContext context, Object globals, String modName, Boolean bottom, Int32 level)
   > IronPython.Modules.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level)
   > Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame frame)
   > Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   > Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)
   > IronPython.Runtime.Importer.ImportLightThrow(CodeContext context, String fullName, PythonTuple from, Int32 level)
   > IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext context, String fullName, Int32 level)
   > Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame)
   > Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   > Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
   > IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
   > IronPython.Compiler.PythonScriptCode.Run(Scope scope)
   > IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)
   > IronPython.Compiler.RuntimeScriptCode.Run(Scope scope)
   > Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink)
   > Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)
   > xxxxxxxxxxxxxxx.Logic.SendMessageByPythonRequests.Execute() > c:\Users\xxxxxxxx\Documents\Visual Studio 2013\Projects\xxxxxx\xxxxxxxxxxxxxxx\Logic\SendMessageByPythonRequests.cs:line 114
   --- End : Stack Trace ---
   > System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   > System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   > System.Reflection.RuntimeMethodInfo.UnsafeInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   > System.Delegate.DynamicInvokeImpl(Object[] args)
   > System.Delegate.DynamicInvoke(Object[] args)
   > xxxxxxxxxxxxxxx.MyTimeout.Operation.Run() > c:\Users\xxxxxxxx\Documents\Visual Studio 2013\Projects\xxxxxx\xxxxxxxxxxxxxxx\MyTimeout.cs:line 78

comments