Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
Hi ,
 

I am getting an exception in C# " System.outOfMemory Exception".
 
Is there is any way to overcome these Exceptiom?
 
Please help.
 
Thanks
Posted 5-Nov-12 6:13am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You've not enough memory to do your operation.
I think you do something with large arrays.
You can try to:
  1. Set objects to null if you don't longer need them.
  2. Try what you do with a smaller array! It's possible that you don't need a large array.
  3. If you've array with a large datatype, try a smaller datatype. If you've an array with longs, try it also with integers. If it doesn't work with integers, then you need to create long. Try to choose the smallest datatype!
 
Hope this helps.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

If you are getting into an infinite loop of some kind, you could get rid of this error by fixing this loop.
Also look at other aspects of code, example, large image size etc that you might be working with.
 
If its a genuine memory issue, then increasing the memory of the system might be one way (although not guaranteed way) to fix the problem.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.140709.1 | Last Updated 5 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid