Click here to Skip to main content
Sign Up to vote bad
good
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:13


2 solutions

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  
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)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 213
1 Sergey Alexandrovich Kryukov 159
2 Richard MacCutchan 150
3 Maciej Los 136
4 Tadit Dash 110
0 Sergey Alexandrovich Kryukov 10,264
1 OriginalGriff 7,937
2 CPallini 4,201
3 Rohan Leuva 3,522
4 Maciej Los 3,135


Advertise | Privacy | Mobile
Web01 | 2.6.130523.1 | Last Updated 5 Nov 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid