Answered by:
Out Of Memory Exception in c#

Question
-
i am facing this type of exception many time any idea ?
Exception of type 'System.OutOfMemoryException' was thrown.,Target : System.Collections.IEnumerator GetEnumerator(),Source : mscorlib,Stack Trace : at System.Collections.ArrayList.GetEnumerator() at Telerik.WinControls.ComponentInputBehavior.ElementUnderMouseMonitorTimer_Tick(Object sender, EventArgs e) at System.Windows.Forms.Timer.OnTick(EventArgs e) at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Answers
-
Hi Addi,
Please explain more about what's going on here.
Just showing the stacktrace does not tell anyone what you're doing before this happens.
I notice:
Telerik.WinControls.ComponentInputBehavior.
Telerik is a third party and this forum is a Microsoft forum, for support on Microsoft products (only).
If this happens when you are just interacting with a Telerik control then I'm afraid your issue is out of scope of this forum. (sorry).
In which case you should ask on the Telerik forums
http://www.telerik.com/forums/wpf
In my experience, Telerik support is very good and you will get good help there.
I suggest you explain more about what's going on if and when you post there because they'll ask the same question as I have.
- Proposed as answer by Albert_Zhang Friday, December 11, 2015 12:34 PM
- Marked as answer by Kristin Xie Tuesday, December 15, 2015 2:09 AM
All replies
-
OutOfMemoryException. Memory is limited. The OutOfMemoryException is triggered by allocation instructions. It is thrown by the .NET Framework execution engine. It can occur during any allocation call during runtime.
Example. In this example, we see a program that attempts to allocate a string that is extremely large and would occupy four gigabytes of memory. But the OutOfMemoryException is thrown by the runtime because this is not possible.class Program { static void Main() { // Attempt to create a string of 2.1 billion chars. // ... This results in an out-of-memory error. // ... It would require 4.2 billion bytes (4 gigabytes). string value = new string('a', int.MaxValue); } } //Output: //Unhandled Exception: OutOfMemoryException.
It's like that you are enumerating value which at some point exceed your memory size.
Thanks,
Sabah Shariq
-
Hi Addi,
Please explain more about what's going on here.
Just showing the stacktrace does not tell anyone what you're doing before this happens.
I notice:
Telerik.WinControls.ComponentInputBehavior.
Telerik is a third party and this forum is a Microsoft forum, for support on Microsoft products (only).
If this happens when you are just interacting with a Telerik control then I'm afraid your issue is out of scope of this forum. (sorry).
In which case you should ask on the Telerik forums
http://www.telerik.com/forums/wpf
In my experience, Telerik support is very good and you will get good help there.
I suggest you explain more about what's going on if and when you post there because they'll ask the same question as I have.
- Proposed as answer by Albert_Zhang Friday, December 11, 2015 12:34 PM
- Marked as answer by Kristin Xie Tuesday, December 15, 2015 2:09 AM
-
-
Sorry but that still isn't enough.
What you have told us is you're doing something or other and after 2 minutes you get that exception and somehow a timer is involved.
If you didn't know anything about that app and it was described to you in those terms, how would you decide what was happening?
You couldn't, it's impossible to tell.
You might be filling a HUGE collection or... pretty much anything really.