Out of memory exception encountered
hello, can anyone tell me why i am getting an out of memory error while creating an object even though i have enough of ram space?
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Joginder BangerRank #360 · 7K reputationPosted Feb 5, 2015, 8:03 PM EST
There is no any difference until you compile to same target architecture. I suppose you are compiling for
32bit architecture in both cases.Worth mention that
OutOfMemoryExceptioncan be raised also if you get2GBof memory allocated by a single collection in CLR (sayList) on both architectures32and64bit.To be able to benefit for possible memory potential goodness on
64bit architecture, you have to compile your code targeting64bit architecture. After that, naturally, your binary will run only on64bit, but will benefit from possibility having more space available in RAM.Pranay RanaRank #735 · 3.2K reputationPosted Feb 5, 2015, 8:36 PM EST
For example
public void rec()
{
rec();
}
if you have code like above system will throw memory exceptiion.
Sanju SinghRank #6,374 · 268 reputationPosted Feb 6, 2015, 5:16 AM EST
Sanju SinghRank #6,374 · 268 reputationPosted Feb 27, 2015, 8:25 PM EST