out of memory? not really!

R

Rainer Queck

Hello NG,

I have a strange situation in one of my apps.
I need to have a couple ob big array. Unfortunately after exeeding a certain
size (wich is not at all the limit of my system)
I get a OutOfMemoryException. Whis is that? Does the framework have limit, I
don't know of?

Here my sample code to demonstarte the problem:
int x = 500 * 1024 * 1024;
Byte[] b = new Byte[x];
Byte[] c = new Byte[x];
Byte[] d = new Byte[x];

Byte array b is allocated without problem.
As soon as I step over allocation c I get the exception!

Thanks for hints, links and help on this problem.

Regards
Rainer Queck
 
C

cfps.Christian

We had the same problem at the company where I work. .NET only allows
itself to use a certain percentage of the system's memory and after
that throws an OutOfMemoryException. I didn't research how to raise
the limit since our application has to be for users will all amounts
of memory so I just got my byte array and chunked up the file into
50mb chunks and moved it around like that.
 
D

Doug Forster

Hi Rainer,

You may be able to improve your situation somewhat by booting with the 3GB
switch and setting the LARGEADDRESSAWARE flag on your exe, but the best
solution is to install a 64 bit OS

Cheers
Doug Forster
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top