Click here to Skip to main content
Rate this: bad
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.
Posted 5-Nov-12 7:13am
Rate this: bad
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.
Rate this: bad
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.

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 424
1 OriginalGriff 375
2 CHill60 230
3 CPallini 220
4 Maciej Los 210
0 Sascha Lefévre 75
1 OriginalGriff 70
2 F-ES Sitecore 55
3 Peter Leow 50
4 Dave Kreskowiak 40

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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100