Reputation: 360
I have a C# programmed application and after about 13 days of running with the debugger of sharp develop 4.2.1,the application throws an OutOfMemoryException.
I am confused because of the fact that the exception stack trace comes from sharp develop. Is this a problem or just misleading ?
I had also out of memory exceptions in the past but everytime the stack trace was shown some code of my project and not from sharp develop. I fixed these issues by using the ANTS memory profiler.
Do you have some ideas ? For longer time of running the application, is the "release" build without debugger running more stable ?
Many thanks in advance.
-------------------------------------------------------------
Complete Stacktrace:
SharpDevelop Version : 4.2.1.8805-9345aa7c
.NET Version : 4.0.30319.1
OS Version : Microsoft Windows NT 6.1.7601 Service Pack 1
Current culture : Japanese (Japan) (ja-JP)
Current UI language : en
Working Set Memory : 1017236kb
GC Heap Memory : 713962kb
Exception thrown:
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Collections.Generic.List`1.set_Capacity(Int32 value)
at System.Collections.Generic.List`1.EnsureCapacity(Int32 min)
at System.Collections.Generic.List`1.Add(T item)
at Debugger.Interop.TrackedComObjects.Track(Object obj)
at Debugger.Interop.TrackedComObjects.ProcessOutParameter(Object parameter)
at Debugger.ManagedCallbackSwitch.GetProcessCallbackInterface(String name, ICorDebugAppDomain pAppDomain)
at Debugger.ManagedCallbackProxy.<>c__DisplayClass58.<Exception>b__57()
at Debugger.MTA2STA.<>c__DisplayClass4.<EnqueueCall>b__1()
at Debugger.MTA2STA.PerformCall()
at Debugger.MTA2STA.PerformAllCalls()
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
---- Recent log messages:
09:37:15.383 [1] DEBUG - Debugger: Callback: Exception
09:37:15.383 [1] DEBUG - Debugger: Process has queued callbacks
09:37:15.384 [1] DEBUG - Debugger: Callback: Exception2 (type=DEBUG_EXCEPTION_FIRST_CHANCE)
09:37:15.391 [1] DEBUG - Debugger: Callback: Exception2 (type=DEBUG_EXCEPTION_USER_FIRST_CHANCE)
09:37:15.391 [1] DEBUG - Debugger: Process has queued callbacks
09:37:15.391 [1] DEBUG - Debugger: Callback: Exception2 (type=DEBUG_EXCEPTION_USER_FIRST_CHANCE)
09:37:15.392 [1] DEBUG - Debugger: Process has queued callbacks
09:37:15.392 [1] DEBUG - Debugger: Callback: Exception2 (type=DEBUG_EXCEPTION_USER_FIRST_CHANCE)
09:37:15.396 [1] DEBUG - Debugger: Callback: Exception2 (type=DEBUG_EXCEPTION_USER_FIRST_CHANCE)
09:37:15.397 [1] DEBUG - Debugger: Callback: Exception2 (type=DEBUG_EXCEPTION_CATCH_HANDLER_FOUND)
09:37:15.397 [1] DEBUG - Debugger: Process has queued callbacks
09:37:15.398 [1] DEBUG - Debugger: Callback: Exception2 (type=DEBUG_EXCEPTION_CATCH_HANDLER_FOUND)
09:37:15.398 [1] DEBUG - Debugger: Process has queued callbacks
09:37:15.399 [1] DEBUG - Debugger: Callback: Exception2 (type=DEBUG_EXCEPTION_CATCH_HANDLER_FOUND)
09:37:15.403 [1] DEBUG - Debugger: Callback: Exception2 (type=DEBUG_EXCEPTION_CATCH_HANDLER_FOUND)
09:37:15.405 [1] DEBUG - Debugger: Callback: Exception
09:37:15.405 [1] DEBUG - Debugger: Process has queued callbacks
09:37:15.407 [1] DEBUG - Debugger: Callback: Exception2 (type=DEBUG_EXCEPTION_FIRST_CHANCE)
09:37:15.410 [1] DEBUG - Debugger: Callback: Exception
09:37:15.410 [1] DEBUG - Debugger: Process has queued callbacks
09:37:15.411 [1] DEBUG - Debugger: Callback: Exception2 (type=DEBUG_EXCEPTION_FIRST_CHANCE)
09:37:15.411 [1] DEBUG - Debugger: Process has queued callbacks
09:37:15.411 [1] DEBUG - Debugger: Callback: Exception
09:37:15.411 [1] DEBUG - Debugger: Process has queued callbacks
09:38:13.301 [1] ERROR - ThreadException caught
--> Exception:
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Collections.Generic.List`1.set_Capacity(Int32 value)
at System.Collections.Generic.List`1.EnsureCapacity(Int32 min)
at System.Collections.Generic.List`1.Add(T item)
at Debugger.Interop.TrackedComObjects.Track(Object obj)
at Debugger.Interop.TrackedComObjects.ProcessOutParameter(Object parameter)
at Debugger.ManagedCallbackSwitch.GetProcessCallbackInterface(String name, ICorDebugAppDomain
pAppDomain)
at Debugger.ManagedCallbackProxy.<>c__DisplayClass58.<Exception>b__57()
at Debugger.MTA2STA.<>c__DisplayClass4.<EnqueueCall>b__1()
at Debugger.MTA2STA.PerformCall()
at Debugger.MTA2STA.PerformAllCalls()
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code,
CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,
ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback
callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback
callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
---- Post-error application state information:
Installed 3rd party AddIns:
Workbench.ActiveContent: <null>
Upvotes: 0
Views: 436
Reputation: 16464
This is a memory leak in SharpDevelop's debugger. It maintains a list of any COM objects it uses, and doesn't release them until the end of the debugging session.
If you need to run your program over long periods of time, you should run it without debugger. If necessary, you can later still attach the debugger to the process.
Upvotes: 3